Forum Discussion
Kenny_Long_5159
Nimbostratus
Oct 11, 2007Send traffic to destination pool based on source IP address
Associates,
I have a virtual server that is tied to a pool (WebServers) that has one "real" member. Then I have a second pool (Testweb) with a different "real" member.
I would like to direct traffic to the different pools based on source IP address when going to the webserver (just HTTP). One particular IP address goes to one pool and the rest of the Internet goes to another.
This is what I have come up with, but I dont have the ability to test it at the moment. Will someone evaluate it and correct it (if needed)? Thanks.
when CLIENT_ACCEPTED {
if {[IP::client_addr] == "10.0.150.1" && [TCP::local_port] == 80} {
pool Testweb
}
else {
pool WebServers
}
}
- dennypayne
Employee
Looks like it will work fine, but I think you will need to use "equals" rather than == and maybe "and" instead of && as well for it to compile (not 100% on that since I'm not on a live box at the moment either). But the logic is OK. - Kenny_Long_5159
Nimbostratus
Thanks for the response. Because the Virtual Server I applied this to is only port 80 I dropped the && for port 80 from this iRule. - pjain_72429
Nimbostratus
How can this be implemented for - Juha_Suominen_3
Nimbostratus
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