Forum Discussion
Dianna_129659
Sep 23, 2013Nimbostratus
Can I block an IP address?
Can I blacklist a specific IP address? Our web scraping is set pretty loose because many of our customers do transactions that appear to be scraping. We are being hit hard by some crawlers, and I wou...
Kevin_Stewart
Sep 23, 2013Employee
As you've never worked with packet filters, I'd strongly recommend reading the following first:
As for the iRule, simply copy the above to a new iRule in the iRules section of the management GUI, and change the xx.xx.xx.xx/xx do a specific IP address (ex. 123.45.678.90) or a specific subnet (ex. 123.45.67.0/24), then add that iRule to the virtual server configuration. You could even throw in some logging to see what IP address is getting blocked (and when).
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals xx.xx.xx.xx/xx] } {
log local0. "Blocking [IP::client_addr]"
reject
}
}
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