Forum Discussion
Ranvir_Floura_7
Nimbostratus
Mar 25, 2009redirect based on source ip address
Need a little help in coming up with an iRule where if the client IP matches i want it going to a pool, if not just redirect to a url. I am missing something here
when CLIENT_ACCEPTED ...
hoolio
Cirrostratus
Mar 26, 2009Hi,
It would be cleaner to define the IP addresses in a datagroup of type 'address' and then use the matchclass command (Click here) to check the client IP against the datagroup.
when HTTP_REQUEST {
Check if client IP is in the datagroup
if {[matchclass [IP::client_addr] equals $::my_client_ips_class]}{
pool xyz
} else {
HTTP::redirect "http://redirect.example.com"
}
}
Aaron
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
