Forum Discussion
DushyantSingh_1
Nimbostratus
Jul 20, 2015URL redirection based on IP and Port information
Hello,
I need to deliver an irule to my client with a condition that traffic will hit on configured VIP 172.x.x.x:80 from two source 160.12.x.x or 90.1.x.x on port 5050 which needs to be routed ...
Kevin_Stewart
Employee
Jul 20, 2015Okay, so:
when HTTP_REQUEST {
if { ( [IP::addr [IP::client_addr] equals 160.12.0.0/16] ) and ( [TCP::client_port] == "5050" ) } {
HTTP::redirect "http://abc.com"
} elseif { ( [IP::addr [IP::client_addr] equals 90.1.0.0/16] ) and ( [TCP::client_port] == "5050" ) } {
HTTP::redirect "http://xyz.com"
}
}
Or
when HTTP_REQUEST {
if { [TCP::client_port] == "5050" } {
if { [IP::addr [IP::client_addr] equals 160.12.0.0/16] } {
HTTP::redirect "http://abc.com"
} elseif { [IP::addr [IP::client_addr] equals 90.1.0.0/16] } {
HTTP::redirect "http://xyz.com"
}
}
}
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