Forum Discussion
2 Replies
Hi Anas A. Hijjawi,
Can you try this iRule after change IPs, subnets and poolname?
when CLIENT_ACCEPTED { if { [IP::addr [IP::client_addr] equals 10.11.12.13/32] && [LB::status pool pool_name member 172.16.20.1 80] eq "up" } { node 172.16.20.1 80 } elseif { [IP::addr [IP::client_addr] equals 10.12.14.0/24] && [LB::status pool pool_name member 172.16.20.2 80] eq "up" } { node 172.16.20.2 80 } else { pool pool_name } }
- wlopezCirrocumulus
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.