Forum Discussion
andre_4691
Nimbostratus
Jul 07, 2008source grouping
Dear All,
Anybody have ever experienced create irules to select server based on source IP Address ?
Example:
IP A will send to Server A as a primary server.
...
hoolio
Cirrostratus
Jul 07, 2008Hi,
You can use priority groups to state that server A is used unless it's down. In that case, server B would be used. You can use a rule like the following to evaluate the client IP address:
when CLIENT_ACCEPTED {
if {[IP::addr [IP::client_addr] equals 1.1.1.1]}{
log local0. "[IP::client_addr]:[TCP::client_port] matched 1.1.1.1"
pool server_a_then_b
} elseif {[IP::addr [IP::client_addr] equals 2.2.2.2]}{
log local0. "[IP::client_addr]:[TCP::client_port] matched 2.2.2.2"
pool server_b_then_a
} else {
Take some default action?
log local0. "[IP::client_addr]:[TCP::client_port] default"
pool default_pool
}
}
You can use IP::addr (Click here) to test for a single host or network, and a datagroup and the matchclass command (Click here) to test for multiple hosts and/or networks.
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