Forum Discussion
Kevin_Stewart
Jul 01, 2014Employee
A slightly different placement of the logic is in order:
when HTTP_REQUEST {
log local0. " Request in [IP::client_addr] [HTTP::host][HTTP::uri]"
if { ( [HTTP::uri] contains "/down.php" ) and not ( ( [IP::addr [IP::client_addr] equals 75.66.12.0/255.255.255.0] ) or ( [IP::addr [IP::client_addr] equals 15.150.0.0/255.255.0.0] ) ) } {
log local0. " Blocked access [IP::client_addr] [HTTP::host][HTTP::uri]"
drop the request
reject
}
}
If you're ever curious about what a logic statement is returning, you can do something like this:
log local0. [expr { ( ( [IP::addr [IP::client_addr] equals 10.80.0.0/255.255.255.0] ) or ( [IP::addr [IP::client_addr] equals 15.150.0.0/255.255.0.0] ) ) }]