Forum Discussion
Mark_Gallagher
Altocumulus
Nov 01, 2019iRule to protect a URI pattern by subnet?
Good day, I have been trying several approaches on BIG-IP/LTM 12.1.3.7 to achieve the following goal: A VIP listens on an IP where most of the traffic is bound for web content, let's say https:...
JG
Cumulonimbus
Nov 02, 2019Try the following:
when HTTP_REQUEST {
if { ([string tolower [HTTP::uri]] starts_with "/admin") && not ([IP::addr [IP::client_addr] equals 192.168.0.0/16]) } {
drop
} else {
pool prd-pl-company
}
}.
Mark_Gallagher
Altocumulus
Nov 04, 2019Thanks for the input JG. I did try this (also with an exclamation point outside the parentheses) and it doesn't seem to match. I have definitely been able to get the match to work with a large list of /32 addresses, but never the /16.
This what I tried as far as what they were recommending in a KB for efficient subnet matching:
when HTTP_REQUEST {
if {( [string tolower [HTTP::uri]] contains "/admin") && (not[IP::addr [IP::remote_addr] equals 192.168.0.0/255.255.0.0])} {
HTTP::respond 503 content {Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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