Marc_Weisbrod_6
Nov 09, 2006Nimbostratus
IRule to redirect to another side based on network
All,
I am trying to write an Irule to redirect users who are not on our local site to another page. I have written this Irule but I am unsure if the Irule can accept subnets.
when HTTP_REQUEST {
if { [[IP::client_addr] is "10.1.0.0/16"] } {
pool http-pool
} elseif {
[[IP::client_addr] is "10.2.0.0/16"] } {
pool http-pool
} elseif {
[[IP::client_addr] is "172.16.0.0/16"] } {
pool http-pool
} else {
HTTP::redirect "http://192.168.0.12/local_only.jsp"
}
}
Basically anyone who connects with 10.1.x.x or 10.2.x.x or 172.16.x.x should get the site, but if you connect from 10.3.x.x you get redirected.
Thanks