alvaro_martinez
Mar 09, 2007Nimbostratus
Use rule Limit Connections From Client
Hi all,
I´m trying to configure rule in bigip config file but I can´t to work correct.
I have the next configuration but when I try connect to virtual server from white list server, the virtual server can´t answer.
How do it for use test-pool?
Virtual description
virtual vs_xxxxxxxx_9000 {
destination xxxxxx:9000
ip protocol tcp
rule load_limit
Rule configuration
rule load_limit {
when RULE_INIT {
array set ::active_clients { }
array set white_client {
1.1.1.1
1.1.1.2
}
}
when CLIENT_ACCEPTED {
set client_ip [IP::remote_addr]
if { [info exists ::active_clients($client_ip)] && ![info exist ::white_client($client_ip)] } {
if {$::active_clients($client_ip) > 10 } {
reject
log local0. "Reject IP $client_ip ($::active_clients($client_ip))"
return
} else {
incr ::active_clients($client_ip)
}
} else {
set ::active_clients($client_ip) 1
pool test-pool
}
}
when CLIENT_CLOSED {
set client_ip [IP::remote_addr]
if { [info exists ::active_clients($client_ip)] && ![info exist ::white_client($client_ip)] } {
incr ::active_clients($client_ip) -1
if { $::active_clients($client_ip) <= 0 } {
unset ::active_clients($client_ip)
}
}
}
}
Regards