Forum Discussion
I need help with an iRule to restrict inbound connections to certain IPs
Hi,
You can use the following irule to disallow access to specific urls to users :
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] starts_with "/devicemanagement/enroll" or [string tolower [HTTP::path]] starts_with "/deviceservices/enrollment/airwatchenroll.aws" and ![class match [IP::client_addr] equals irdg-mdm-test] } {
log local0. "[IP::client_addr] - Matched default policy: Access Denied"
reject
return
}
}
This irule will allow IP addresses defined in the datagroup named irdg-mdm-test to access specified urls. Other IPs will be rejected.
Maybe, you can also change the
reject command to something more user friendly like
HTTP::respond 403 content "Request Not Allowed"
Note : Pay attention that you don't have other irules, LTM policies or whatever else that bypass this irule processing.
Hi,
Hi updated the irule above. Can you check that you get the logs from the irule in the /var/log/ltm logfile ?
Do you have some proxy or reverse proxy between F5 and the client ?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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