Hi mahfuz710 ,
You can create a single rule to achieve the requirement. Create a datagroup to define the client ip and based on it either select the pool or pool member.
First rule is to select different pool based on the client ip
when CLIENT_ACCEPTED {
if { [class match [IP::client_addr] equals datagroup1] } {
pool pool1
log local0. "[IP::client_addr] is 1"
} elseif { [class match [IP::client_addr] equals datagroup2] } {
pool pool2
log local0. "[IP::client_addr] is 2"
} else {
pool pool3
log local0. "[IP::client_addr] is 3"
}
}
Below is to select pool member based on the client ip
when CLIENT_ACCEPTED {
if { [class match [IP::client_addr] equals datagroup1] } {
pool pool1 member 10.10.10.11 80
log local0. "[IP::client_addr] is 1"
} elseif { [class match [IP::client_addr] equals datagroup2] } {
pool pool1 member 10.10.10.12 80
log local0. "[IP::client_addr] is 2"
} else {
pool pool1 member 10.10.10.13 80
log local0. "[IP::client_addr] is 3"
}
}