Subhajit1107_38
Apr 11, 2019Nimbostratus
iRule to block IP and URL
Hi,
I want an iRule to block a set of IP's hitting a set of url's and log the blocking Could you please check the below iRule and update if any error.
when HTTP_REQUEST {
set url [HTTP::host][HTTP::uri]
if {[class match $url contains blocklist_url] and [class match [IP::client_addr] equals restrict_ip]} {
drop
log local0. "Blocking clientIP:[IP::client_addr] trying to access $url"
}
}