Forum Discussion
wlopez
Oct 22, 2020Cirrocumulus
Anas,
You can create two pools, one for each client address using Priority Group.
You can then combine them with an iRule to get the behavior you described.
As far as persistence goes you're probably better off doing that at the virtual server level.
No real need to do it within an iRule.
Pool for A:
pool_for_A
Health Monitors = whatever is appropriate for the application/service on X and Y
Priority Group Activation = Less Than 1
Members:
10.0.0.X Priority 2
10.0.0.Y Priority 1
Pool for B:
pool_for_B
Health Monitors = whatever is appropriate for the application/service on X and Y
Priority Group Activation = Less Than 1
Members:
10.0.0.X Priority 1
10.0.0.Y Priority 2
# iRule to select pool based on source IP
when CLIENT_ACCEPTED {
# Select pool for client A
if { [IP::remote_addr] equals "10.0.0.A" } {
pool pool_for_A
}
# Select pool for client B
if { [IP::remote_addr] equals "10.0.0.B" } {
pool pool_for_B
}
}
Hope that helps.