Forum Discussion
Thomas_Heloin_3
Jan 23, 2012Historic F5 Account
Hello,
You might want to try this.
I had the same question today through support. Once you are happy with your testing, you can make it more efficient by removing the log and else statement
when CLIENT_ACCEPTED {
if { [table incr [IP::client_addr]] > [class match [IP::client_addr] equals conn_limit] } {
log local0. "counter: [table lookup [IP::client_addr]]"
table incr [IP::client_addr] -1
TCP::close
Tested in v11.1 HF1, TMM is not stable when doing TCP::close and table manipulation in CLIENT_CLOSED event
This solution appears more stable, no guarantees however.
event CLIENT_CLOSED disable
} else {
log local0. "counter: [table lookup [IP::client_addr]]"
}
}
when CLIENT_CLOSED {
table incr [IP::client_addr] -1
log local0. "counter: [table lookup [IP::client_addr]]"
}
The Data Group looks like this;
class conn_limit {
network 172.0.0.0/8 { "2" }
}
Thomas