Forum Discussion
zhaleh_329474
Jan 08, 2019Nimbostratus
f5 irule redirect based on source ip
Hello
I want redirect to for specific 5 subnet ip address,and If these 5 addresses were not requested, they should be redirected to another address example to .
Rico
Jan 09, 2019Cirrus
zhaleh,
Try this iRule
when HTTP_REQUEST {
if {[IP::addr 10.0.0.0/8 equals [IP::client_addr]]} {
HTTP::redirect http://bbb.com[HTTP::uri]
} else {
HTTP::redirect http://ccc.com[HTTP::uri]
}
}
You can use the IP::addr command to compare the subnets of the IP address. The if statement would also work like this:
if {[IP::addr "10.0.0.0 mask 255.0.0.0" equals [IP::client_addr]]} {
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