Forum Discussion
arun_parthas_10
Nimbostratus
Mar 18, 2009Need help with writing an Irule
Hi
I have a situation where I have 4 clients hitting a VIP with two servers behind..
I am having a Least Connection ( member ) as LB method and Persistence set for 4 hours.. the problem I am having is that 3 clients are bound to server1 and 1 remaining client connect to server 2.. I need help in writing a iRule where I would like to force clients 1&2 to Server 1 ( have Server 2 as failback host ) and client 3 and 4 to Server 2 ( have Server 1 as failback host ), so I make use of both servers on the backend equally.. I will not need to use persistence if I can achieve this . Please see the scenario mentioend below :
1. Tie the first two external hosts ( apache1, apache2 ) with one backend host1 (new pool ) also by having a backup host2.
2. Tie the Second two external hosts ( apache3, apache4 ) with one backend host2 (new pool ) also by having a backup host1.
Any help on this would be greatly appreciated.
Arun P
- dennypayne
Employee
Hi Arun,when CLIENT_ACCEPTED { if { ([IP::addr [IP::client_addr] equals x.x.x.x) || ([IP::addr [IP::client_addr] equals y.y.y.y) pool pool1 } else { pool pool2 } }
- arun_parthas_10
Nimbostratus
Hi Denny - dennypayne
Employee
The syntax you have given forces first two client IP's to a Pool with one server.. Not sure what happens if server in Pool 1 goes off line
- arun_parthas_10
Nimbostratus
Denny - L4L7_53191
Nimbostratus
The error mentions you're missing close brackets - it looks like they're missing off of the IP::addr command. Try this (haven't tested it)when CLIENT_ACCEPTED { if { ([IP::addr [IP::client_addr] equals 172.24.81.20]) || ([IP::addr [IP::client_addr] equals 172.24.8.16]) pool beta-cpc-web-pool-1-12100 } else { pool beta-cpc-web-pool-2-12100 } }
- arun_parthas_10
Nimbostratus
Matt - hwidjaja_37598
Altostratus
what about this:when CLIENT_ACCEPTED { if { ([IP::addr [IP::client_addr] equals 172.24.81.20]) || ([IP::addr [IP::client_addr] equals 172.24.8.16]) } { pool beta-cpc-web-pool-1-12100 } else { pool beta-cpc-web-pool-2-12100 } }
- arun_parthas_10
Nimbostratus
this worked. thanks a lot guys..
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