Forum Discussion
steven_singer_8
Nimbostratus
Sep 25, 2014Per-IP rate limiting for non-matching IPs
I wrote an iRule that 403'ed any requesting IPs that did NOT match a class of IPs.
rule filter_clients_rule {
when HTTP_REQUEST {
if { [matchclass [IP::client_addr] equals $::MySelfDefined_Network_class] } {
pool regular-site-pool
}
else {
HTTP::respond 403
}
}
}
How would one write a similar rule for ASM to simply throttle those non-matching IPs?
1 Reply
- Stewart
Altostratus
You could do something like this assuming your default pool is "regular-site-pool" and you'd need to create the rate class "non-matching-IPs as well:
rule filter_clients_rule { when HTTP_REQUEST { if { [matchclass [IP::client_addr] not $::MySelfDefined_Network_class] } { rateclass non-matching-IPs } } }`
This isn't using ASM though.
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