Forum Discussion
Kris_Peters_140
Nimbostratus
Aug 19, 2015URL Redirect based on site IP
This might have already been asked, but I cannot find it...
I have four media caching servers at four different locations. I need an irule that checks the source IP of the HTTP request and redirec...
Michael_Jenkins
Cirrostratus
Aug 19, 2015You should be able to use the
IP::client_addr command to get the client ip address and check that against addresses manually or use a data group to handle that (then you can set the node manually)
Manual check and set to node
when HTTP_REQUEST {
if {[IP::addr [IP::client_addr] equals 10.10.1.0/24]} {
node 10.1.1.1
} elseif {[IP::addr [IP::client_addr] equals 10.8.1.0/24]} {
node 10.8.1.1
}
}
You could also use a datagroup to handle the client ip and destination ip:
Check against datagroup
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals ADDR_DATAGROUP] } {
node [class match -value [IP::client_addr] equals ADDR_DATAGROUP]
}
}
Hope this helps.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
