Forum Discussion
FlorianM_29948
Nimbostratus
Nov 27, 2012Restrict access by uri and ip
Hi everyone i'm new to the F5 community and i'm having troubles with an iRule.
I need to be abble to restrict the access of many uri based on multiple ip addresses who may vary between ea...
What_Lies_Bene1
Cirrostratus
Nov 27, 2012This reduces it somewhat;
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/error*" {
if { (([class match [IP::client_addr] equals ipgrouptest]) or ([class match [IP::client_addr] equals ipgrouptest2])) } {
If the client IP match the ipgrouptest/2 class we do nothing
}
else { HTTP::respond 403 }
}
"/example*" {
if { (([class match [IP::client_addr] equals ipgrouptest]) or ([class match [IP::client_addr] equals ipgrouptest3])) } {
If the client IP match the ipgrouptest/3 class we do nothing
}
else { HTTP::respond 403 }
}
}
}
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