I’m trying to use the “switch” syntac command to load balance traffic based on a client’s subnet/network address. I have a list of subnets that would need to be listed to load balance to the test_pool and everything else would go to the default pool. Here is what I have.
when CLIENT_ACCEPTED {
set IPADDR [IP::remote_addr]
switch $IPADDR {
192.168.100.0/255.255.255.192
{
pool test_pool
}
default
{
pool default_pool
}
}
}
The actual “syntac” of this rule works, but I can’t seem to get the “functionality” to work. Can anyone help with this.
thanks for the reply. I can use the if/elseif syntac, but for what i’m trying to do, that would be a long script. We use vlans and most of our segments are 64 and 128 address segments. Campus wide we have about 800 vlans. If I was to elseif all the segments for this, it would be too long. I’m trying to figure out how to use the switch command to list all my variables to test against then send the client to the right pool. Hopefully, i explained it a little better. Thanks