Assistance with iRule using port ranges
Hello all!
I currently have a VIP that is listening over various ports, 4400-4699. The owner of the app is having the client statically set a port when connecting to the VIP and would like to load balance to a particular member based on the port entered.
I built out an iRule for this and I am getting an error stating undefined procedure:tcp::local_port. Can I get some advice on what I am doing wrong here? Thanks in advance!
when CLIENT_ACCEPTED {
if { ( [TCP::local_port] > 4399 ) or ( [TCP::local_port] < 4499 ) } {
pool hjapp.portlist.pool member 10.11.20.52:0
} elseif { ( [tcp::local_port] > 4500 ) or ( [tcp::local_port] < 4700 ) } {
pool hjapp.portlist.pool member 10.11.20.58:0
}
}
it seems because you define the tcp port as ...:0 instead of
https://clouddocs.f5.com/api/irules/pool.htmlit will be tidier if you put .52 and and .58 in separate pools so you dont need to define pool member in the irule.
you can use pool's priority group activation in each pool if you want both to be members.btw, it's better to use gui based traffic policy to avoid scripting typo