Forum Discussion
icopperman_1347
Nimbostratus
Oct 01, 2013can we direct traffic based on IP address
we have two servers (srvr1, srvr2) behind a F5 load balancer.
Is it possible to write an iRule (or any other type of rule ) to direct the traffic based on IP address? Specifically, i would like...
What_Lies_Bene1
Cirrostratus
Oct 01, 2013You might be better off using two separate Virtual Servers and the Priority Group Activation feature but if you really must have an iRule;
when CLIENT_ACCEPTED {
If the source IP address is in the internal network;
if { [IP::addr [IP::remote_addr] equals x.x.x.x/xx] } {
continue and check if both Pool members are up
if { [active_members pool_name] > 1 } {
if so, select our prefered pool member for internal traffic;
pool pool_name member x.x.x.x
}
else {
if not, exit and let the standard load balancing method do it's thing
return
}
If not an internal, assume it's an external IP and check if both Pool members are up
elseif { [active_members pool_name] > 1 } {
If so, select our prefered pool member for external traffic;
pool pool_name member x.x.x.x
}
else {
if not, exit and let the standard load balancing method do it's thing
return
}
}
}
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