i have not yet had an idea how to test with http traffic (short-lived connection) but it seems okay with ssh. i am running 11.6.0 hf4.
configuration
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
cmp-enabled no
destination 172.28.24.10:22
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 19
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo
ltm pool foo {
load-balancing-mode least-connections-member
members {
200.200.200.101:22 {
address 200.200.200.101
}
200.200.200.111:22 {
address 200.200.200.111
}
}
slow-ramp-time 0
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when RULE_INIT {
set static::pool_name "foo"
set static::members_cmd "members -list $static::pool_name"
set static::pool_list [eval $static::members_cmd]
unset -nocomplain static::pool_conn
foreach static::pool_mbr $static::pool_list {
set static::pool_conn([lindex $static::pool_mbr 0]) 0
}
unset static::pool_name static::members_cmd static::pool_mbr
}
when LB_SELECTED {
increase counter
set server_ip [LB::server addr]
incr static::pool_conn($server_ip)
log
set log_conn "client:[IP::client_addr]:[TCP::client_port] "
foreach elm $static::pool_list {
append log_conn "[lindex $elm 0]:$static::pool_conn([lindex $elm 0]) "
}
log local0. $log_conn
}
when CLIENT_CLOSED {
decrease counter
incr static::pool_conn($server_ip) -1
}
/var/log/ltm
[root@ve11a:Active:In Sync] config tail -f /var/log/ltm
Jun 5 13:16:02 ve11a notice mcpd[8104]: 01070639:5: Pool /Common/foo member /Common/200.200.200.111:22 session status forced disabled.
Jun 5 13:16:24 ve11a info tmm[30284]: Rule /Common/qux : client:192.168.206.117:59163 200.200.200.111:0 200.200.200.101:1
Jun 5 13:16:37 ve11a info tmm[30284]: Rule /Common/qux : client:192.168.206.117:59167 200.200.200.111:0 200.200.200.101:2
Jun 5 13:16:46 ve11a info tmm[30284]: Rule /Common/qux : client:192.168.206.117:59169 200.200.200.111:0 200.200.200.101:3
Jun 5 13:16:55 ve11a notice mcpd[8104]: 01070639:5: Pool /Common/foo member /Common/200.200.200.111:22 session status enabled.
Jun 5 13:17:02 ve11a info tmm[30284]: Rule /Common/qux : client:192.168.206.117:59174 200.200.200.111:1 200.200.200.101:3
Jun 5 13:17:10 ve11a info tmm[30284]: Rule /Common/qux : client:192.168.206.117:59177 200.200.200.111:2 200.200.200.101:3
Jun 5 13:17:17 ve11a info tmm[30284]: Rule /Common/qux : client:192.168.206.117:59179 200.200.200.111:3 200.200.200.101:3
Jun 5 13:17:24 ve11a info tmm[30284]: Rule /Common/qux : client:192.168.206.117:59182 200.200.200.111:3 200.200.200.101:4
Jun 5 13:17:31 ve11a info tmm[30284]: Rule /Common/qux : client:192.168.206.117:59185 200.200.200.111:4 200.200.200.101:4