f5_newbie_10463
Apr 17, 2012Nimbostratus
Source Address Persistence with multiple ports
I have one virtual IP with the same pool members but are using multiple ports.The ports are 3446, 3447,7889,7990. I applied an iRule so it will persist looking into the ip address and the port being used. certain issues arise using the irule:
- no statistics appears on the pool members and also on the persistence records
- when a user log-in using 3446, then he tries to log-in using 3447 the session for 3446 will be logged off.but this does not happen when directly accessing server.
please check the irule:
when CLIENT_ACCEPTED {
set LB port based on requested port
switch [TCP::local_port] {
3446 {set port 3446}
3447 {set port 3447} }
log local0. "\$port = $port"
check for existing persistence record
if it exists, directly select node by address:port
set persist "[IP::client_addr]"
log local0. "\$persist = $persist"
set server [session lookup uie [list $persist]]
log local0. "\$server =$server"
if {($server != "") && ($port != "")}{ node $server $port
log local0. "persisting [IP::client_addr]:[TCP::client_port] to $server:$port" }
else {
log local0. "no persist connection" }
}
when LB_SELECTED {
add session table entry (5 min timeout)
log local0. "server in selected = $server" if {$server >= "1"}{
log local0. "persist an forward to = $server" }
else { set server [LB::server addr]
if {$server != ""}{ session add uie [list $persist] $server 1800
log local0. "add persitence record: $persist $server :$port 1800" }
else { log local0. "no server selected" } }
I hope anyone can help me on this one. Thank you.