Forum Discussion
Loab Balancing base on source IP Addresses.
You didn't mention if other source addresses should load balance to both, so I'll assume yes. There are a few different ways to approach this, so here is is just one.
Create three pools:
-
BRM-App that contains both pool members
-
A separate pool that contains both pool members but applies priority group activation to prefer one pool member over the other (let's call this BRM-App-1).
-
And another pool that contains both pool members but applies priority group activation to prefer the other pool member (let's call this BRM-App-2).
Now you could use CPM (LTM policies), but for the sake of understanding the logic, here's an iRule that switches between the pools based on source address:
when CLIENT_ACCEPTED {
switch [IP::client_addr] {
"192.168.1.1" -
"192.168.1.2" -
"192.168.1.3" { pool BRM-App-1 }
"192.168.1.4" -
"192.168.1.5" -
"192.168.1.6" { pool BRM-App-2 }
default { pool BRM-App }
}
}
Here you're allowing native load balancing to happen in each case, but for specific source addresses, preferring one member over another based on source address. If the preferred in that pool fails, then the secondary will take over.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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