Forum Discussion
Eric_Frankenfie
Nimbostratus
Jul 07, 2010Restricting Access to URI Based on IP Address
Is there a way for an iRule to restrict access to an URI based on IP address?
I would like UNRESTRICTED access to:
https://qa.ipcws.fiserv.com
I would like to RESTRICT access by IP address to:
https...
Kevin_Stewart
Employee
Apr 22, 2013So you're saying, "if the requested path contains the string '/myword' and the client IP is NOT 127.0.0.01, then send a 'URL Blocked' message". Is this your intention?
As a quick test, please modify your iRule as follows and report the results:
when HTTP_REQUEST {
log local0. "Path = [string tolower [HTTP::path]]"
log local0. "Client IP = [IP::client_addr]"
if { [IP::addr [IP::client_addr] equals 127.0.0.01/32] } { log local0. "Local client IP" }
if { ( [string tolower [HTTP::path]] contains "/myword " ) and not ( [IP::addr [IP::client_addr] equals 127.0.0.01/32] ) } {
log local0. "dropped"
HTTP::respond 200 content "URL Blocked"
}
}
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
