Forum Discussion
Greenberg
Nimbostratus
Mar 08, 2012iRule to Limit Connections from Source IP to Destination IP
Guys,
Novice to iRules brings himself before you.
I've been given a requirement to Limit the number of Connections from a number of Source Hosts to a Destination.
This ...
Greenberg
Nimbostratus
Mar 09, 2012Guys,
I think I've solved it, subject to testing of course:-
when RULE_INIT {
set ::max_connections 100
set static::active_connections 0
}
when HTTP_REQUEST {
if { not [HTTP::cookie exists ] and $::active_connections > $::max_connections} {
HTTP::respond 302 Location "" "Connection" "Close" "Cache-Control" "no-cache" "Pragma" "no-cache"
TCP::close
} { incr ::active_connections 1
}
}
when CLIENT_CLOSED {
incr ::active_connections -1
}
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