Forum Discussion
TMcGov_92811
Nimbostratus
Jan 23, 2009Using matchclass to check Source IP with HTTP_REQUEST?
F5 Posting
Hi,
With this iRule I am hoping to direct certain Source IP addresses to Pool-A while directing other HTTP Requests based on URIs to other pools. The syntax is...
hoolio
Cirrostratus
Jan 26, 2009Hi,
I think this might implement the logic you're looking for. If not, try adding logging to the iRule and then modify it as you require.
when CLIENT_ACCEPTED {
Check if the client IP is in the testips datagroup
if { [matchclass [IP::client_addr] equals $::testips] } {
Select poolA and track that we've selected a pool
pool poolA
set pool_selected 1
} else {
Continue checking the URI to select a pool
set pool_selected 0
}
}
when HTTP_REQUEST {
Check if the pool has already been selected
if {$pool_selected}{
Exit this event in this rule
return
} else {
Check the requested path
switch -glob [HTTP::path] {
"*/cf/*" -
"*/hf/*" {
pool poolB
}
"*/asweb/* {
pool poolC
}
"*/vh/* {
pool poolD
}
default {
pool poolE
}
}
}
}
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects