Forum Discussion
Nolan_Jensen
Cirrostratus
Sep 24, 2019Source IP and http path restriction via irule or LTM policy
I am trying to figure out the best way to accomplish the below scenario so any help you can provide would be greatly appreciated. I would like to be able to allow and block certain IP's and htt...
Sep 24, 2019
Hi Nolan Jensen,
Only rule2 is enough. I think, wildcard characters not working in policy. I'm not sure. You can use "starts with" instead of "is", and remove wildcard (*).
iRule:
when HTTP_REQUEST {
if { not ([class match [IP::client_addr] equals nolan_test]) } {
switch -glob [string tolower [HTTP::uri]] {
"/maintenancepagedev/swagger/*" -
"/maintenancepagedev/api/remove/*" -
"/maintenancepagedev/api/update/*" -
"/maintenancepagedev/api/set/*" -
"/treecoupondev/*" {
# log local0. "Uri: [HTTP::uri] ClientIP: [IP::client_addr]"
reject
}
default {
# log local0. "Uri: [HTTP::uri] ClientIP: [IP::client_addr]"
}
}
}
}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