Eliran_A
Feb 17, 2020Nimbostratus
Block sites but allow access to specific IP'S
Hi All
I am trying to setup IRule to block website to all ip's except my offices IP
I created the IRule but for some reason it's blocking also the office IP'S
anyone have Idea why it's happen?
the test_allow_IP is a data group i created with all the offices IP.
when HTTP_REQUEST {
set low_host [string tolower [HTTP::host]]
if {(( $low_host starts_with "www.example.com.au" ) || ( $low_host starts_with "example.com.au" ) ) && ( not [class match [IP::client_addr] equals test_allow_IP] )} {
HTTP::respond 404 content "Blocked by irule" log local0. "$low_host traffic has come from blocked subnet"
}