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, 2013It's probably worth some debug logging:
when HTTP_REQUEST {
log local0. "Client: [IP::client_addr]"
if { ( [IP::addr [IP::client_addr] equals 10.1.1.1] ) or ( [IP::addr [IP::client_addr] equals 10.1.1.2] ) } {
log local0. "Redirecting"
HTTP::redirect "http://10.200.200.200"
} else {
log local0. "Not redirecting"
}
}
You can tail the LTM log from the management shell:
tail -f /var/log/ltm
Or watch it from the Logs section of the management GUI. I prefer the former.
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