Forum Discussion
eliton_199802
Nimbostratus
Aug 24, 2018iRule to redirect to URLs
Hi All,
I am in need of an iRule that redirects users to URLs based on their source IP. I am attaching it to a standard VS with no pool defined. This is what I have come up with, however it does no...
Phips_306701
Nimbostratus
Aug 24, 2018You should use a more optimized solution with "switch" instead of "if"
https://devcentral.f5.com/articles/irules-optimization-101-01-if-elseif-and-switch
Code
when CLIENT_ACCEPTED {
switch -glob [IP::client_addr] {
"192.168.5.*" { pool pool1 }
"192.168.6.*" { pool pool2 }
"192.168.7.*" { pool pool3 }
default { pool default_pool }
}
}
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