Forum Discussion
scott_doty_2411
Nimbostratus
Sep 27, 2006Redirect to VIP based on source IP
Is it possible with iRules to redirect traffic destined for one VIP to a different VIP based on the source IP address of the traffic. In other words if 10.10.10.10 is connecting to VIP "VIP1" redirect him to "VIP2". All other traffic allow to pass normally... Any help you folks could give would be greatly appreciated!!
- hoolio
Cirrostratus
If you want to redirect a single client to a different URL (or VIP), you can use a rule like this:when HTTP_REQUEST { if { [IP::addr [IP::remote_addr] equals 10.0.0.10] } { HTTP::redirect "http://my.vip.example.com/" } }
class my_hosts_networks_class { network 10.0.0.0 mask 255.0.0.0 host 192.168.0.100 }
when HTTP_REQUEST { if { [matchclass [IP::remote_addr] equals $::my_hosts_networks_class] } { HTTP::redirect "http://my.vip.example.com/" } }
- scott_doty_2411
Nimbostratus
Thanks hoolio. I get an error when trying to do the first option below: - hoolio
Cirrostratus
Ah, you caught me! I had a couple of logic and syntax errors in the first post, that I edited shortly thereafter. - scott_doty_2411
Nimbostratus
Unfortunately this did not work. I point http traffic at the VIP that this iRule sits on from the source address specified in the rule, but the traffic is not redirected at all--it simply passes through to the pool. Any thoughts?
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