Forum Discussion
JIMQ_46966
Nimbostratus
Aug 13, 2008Irule - Destination Based Routing
Hello, I would like to use an Irule to block access from specific subnets. I was wondering what's the correct syntax for the "subnet" parameter. Can you use
"/16" or "255.255.0.0"
Thanks a Bunch. - - -Jim
example 1
when CLIENT_ACCEPTED {if { [matchclass IP::local_addr] equals $::172.17.0.0/16] } {
close
}
}
or
example 2
when CLIENT_ACCEPTED {if { [matchclass IP::local_addr] equals $::172.17.0.0 255.255.0.0] } {
close
}
}
- Nicolas_Menant
Employee
when CLIENT_ACCEPTED { if { [IP::addr [IP::client_addr]/16 equals 172.17.0.0] } { reject } }
- JIMQ_46966
Nimbostratus
Thanks for responding. I would like to clarify what I am trying to accomplish. I have to allow only certain networks to the following URL "friendsandfamily.condodirect.com". I have to block all others or send to static page indicating they are not allowed to hit this site. - James_Quinby_46Historic F5 AccountWhy not turn it around? (I'm not in a place where I can test this atm...)
when HTTP_REQUEST { if { [IP::addr [IP::client_addr]/16 equals 172.22.0.0] and [HTTP::uri] contains "friends" }{ pool friendsandfamily-condodirect-80 } else { reject } }
- JIMQ_46966
Nimbostratus
Correction on the pool name. It's actually "condodirect-80". From the outside world "INTERNET" everyone is allowed to hit "www.condodirect.com". I have to block the outside world to "friendsandfamily.condodirect.com". This site should only be accessible from internal networks. Hopefully this clarifies what I am trying to accomplish.
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