Forum Discussion
Jim_Bo
Aug 18, 2020Nimbostratus
iRule to selectively allow limited access by client IP
I have an application which is internet accessible but the application team has asked me to limit access to specific URIs based upon client ip. I just cannot seem to get the logic right. I am ...
Aug 18, 2020
Hi Jim_Bo,
Can you try this?
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals private_net] } {
# allow access
}
elseif { [class match [HTTP::uri] equals allowed-uri-list] } {
# allow access
}
else {
HTTP::respond 404 content "404 Not Found"
}
}
or
when HTTP_REQUEST {
if { not ([class match [IP::client_addr] equals private_net] || [class match [HTTP::uri] equals allowed-uri-list]) } {
HTTP::respond 404 content "404 Not Found"
}
}
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