Forum Discussion
alvaro_martinez
Nimbostratus
Mar 09, 2007Use 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
- The_Bhattman
Nimbostratus
It's better to use the iRULE text field in the gui and then you can selected it for the virtual server xxxxx:9000 - Nicolas_Menant
Employee
hi, - David_Homoney
Nimbostratus
Also you may want to check out the iRule Editor, it is extremely useful in iRules developement. Link below.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects