Forum Discussion
Pete_Paiva_7147
Nimbostratus
Oct 17, 2013iRule redirect based on client IP address
Hi all,
Need some assistance creating an iRule based on traffic originating from 2 source IP's:
Source IP:
10.1.1.1
10.1.1.2
If traffic comes into an existing vip (10.100.100...
Kevin_Stewart
Employee
Oct 17, 2013Please try this:
when HTTP_REQUEST {
if { ( [IP::addr [IP::client_addr] equals 10.1.1.1] ) or ( [IP::addr [IP::client_addr] equals 10.1.1.2] ) } {
HTTP::redirect "http://10.200.200.200"
}
}
You could also source the IP information from an address-based data group and make your iRule much simpler:
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals my_ip_dg] } {
HTTP::redirect "http://10.200.200.200"
}
}
where "my_ip_dg" is an address-based data group that can hold various IPs and IP subnets.
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