Forum Discussion
raphael_norber1
Nimbostratus
Sep 16, 2006redirect on IP addy
im trying to do a simple rule. i want to specify multiple ip addresses/ranges that will goto a pool, and everyone else redirected to a different site. im trying to use "or" to add multiple ranges, but my syntax is messed up somewhere. below is my rule. ultimately, it would be nice to create a list of some kind and be able to add/remove ips from the list rather than joining a bunch with or's. much appreciate any help:
when HTTP_REQUEST {
if { (not [IP::addr [IP::client_addr] equals 10.2.1.0/255.255.255.0]) or
(not [IP::addr [IP::client_addr] equals 10.1.6.0/255.255.255.0]) } {
HTTP::redirect "http://sitedown.website.com/sitedown.html"
} else {
pool www
}
}
- raphael_norber1
Nimbostratus
ok, i figured out the datagrups concept...i think. - raphael_norber1
Nimbostratus
haha. i found my own error. i feel like an idiot. missing " in front of the url i wanted to redirect to! wierd that the irules editor didnt catch it. i think im all set! Thanks to everyone on this forum, this is a great help for those of us infrastructure dorks that cant program ourselves out of a wet paper bag! - Colin_Walker_12Historic F5 AccountIt probably didn't catch it because you don't need the quotes for that command. You can supply the string with or without it.
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