Forum Discussion
midhun_108442
Nimbostratus
Jan 21, 2012Help need to create a irule for limit Client Connection
Hi,
Can anyone help us to create a irule to limit number of client connection hitting to Virtual server , I got the same irule scenario in Dev central site for (iRule.Limit Connection from C...
midhun_108442
Nimbostratus
Jan 24, 2012Hi Aaron/Thomas,
Thanks for you support.
I have configured the Irule and tested , its working fine .
Provided Irule wil block all Tcp connection , but i m looking for http/s request per client connection and i got the irule which match our requirement and tested its working , below is the Irule FYI
when RULE_INIT {
this is the life timer of the subtable object. defines how long this object exist in the subtable
set static::maxRate 10
This defines how long is the sliding window to count the requests. This example allows 10 requests in 3 seconds
set static::windowSecs 3
set static::timeout 30
}
when HTTP_REQUEST {
if { [HTTP::method] eq "GET" } {
set getCount [table key -count -subtable [IP::client_addr]]
log local0. "getCount=$getCount"
if { $getCount < $static::maxRate } {
incr getCount 1
table set -subtable [IP::client_addr] $getCount "ignore" $static::timeout $static::windowSecs
} else {
log local0. "This user $user has exceeded the number of requests allowed. "
HTTP::respond 501 content "Request blockedExceeded requests/sec limit."
return
}
}
}
can u help me to chnage this irule base on different connection limit for each client by using data group,
Appreciate your support on this
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
