Shay_Ben-David1
Oct 16, 2006Nimbostratus
need help to convert from v9 to 4.5
i recently got an old Bigip for test env, i used irule only with my 6400 on ver 9.x, now i need to migrate few irules from 9.x to 4.5, mybee someone here can know how it can be done ?
the idea of this irule is to log multiple connections based on source ip and it can do reject to the violators.
here is my irule:
when RULE_INIT {
array set ::active_clients { }
array set white_client {
x.x.x.x
y.y.y.y
}
}
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) > 30 } {
discard
log "Reject @sitename $client_ip ($::active_clients($client_ip))"
return
} else {
incr ::active_clients($client_ip)
}
} else {
set ::active_clients($client_ip) 1
}
}
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)
}
}
}
thanks