Forum Discussion
Nikolay_Matveev
Nimbostratus
Feb 12, 2015select a pool based on source IP and then amend headers based on selected pool
Hi,
Could you advise how I can achieve the following goal, please?
I have two web servers - external (3rd party - server1.external.com) and internal (server2.internal.com). I need to present thes...
Nikolay_Matveev
Nimbostratus
Feb 12, 2015Yes, perhaps there are two options here - one is to have two pools with one server in each OR have a single pool with two servers in it... not sure what would the recommended option be. My thinking was that two pools would be a more universal solution (as then I could add servers to each of the pools) but I do not know how to reference pool name.
The code below does not seem to be working
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 10.0.0.0/8] } {
pool POOL_FOR_EXTERNAL_SERVERS
}
else {
pool POOL_FOR_INTERNAL_SERVERS
}
}
when HTTP_REQUEST {
if { [LB::server pool] eq "POOL_FOR_EXTERNAL_SERVERS" } {
<....handling headers for the external servers..>
} else {
<.. handling headers for the internal servers ..>
}
}
What am I doing wrong here?
Brad_Parker
Cirrus
Feb 12, 2015doing it with pools would make it scale-able if you needed to add servers and the syntax is correct you have here. What's not working exactly, the pool selection? Try adding some logging to see what's happening. Throw something like 'log local0. "External(or Internal) Pool [IP::client_addr]" ' to you if/else statements and see what gets logged.
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