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 to different URL xyz.com or abc.com.
Client_Accept doesn't work with redirect to. Please help.
2 Replies
- Kevin_Stewart
Employee
I'm assuming you're talking about source addresses in the 160.12.0.0 and 90.1.0.0 ranges. Is 5050 a source port? Otherwise:
when HTTP_REQUEST { 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" } } - Kevin_Stewart
Employee
Okay, 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