Forum Discussion
N_67263
Nimbostratus
Oct 06, 2014iRule heelp needed to allow only specific IP addresses.
Folks,
I am looking for an iRule which allow particular source IP only if a particular URI is in the http request.
If this URI is not in the request it should allow all IP's.
e.g. http://nik.te...
nathe
Cirrocumulus
Oct 07, 2014"http://nik.test.com/support/test.html should be allowed for only certain IP's as "/support/test.html" is in the iRule. If it is something like http://nik.test.com/xyz/xyz.html it should just allow all the IP addresses."
Sounds like you just need to restrict access to one URI. Hopefully this irule is simpler. You'll need to created a datagroup with a list of your allowed IP addresses first then:
when HTTP_REQUEST {
if { ([HTTP::uri] ends_with "/support/test.html") and not ([class match [IP::client_addr] equals allowed_ips]) } {
reject
}
}
Not near my iRule editor to 100% check syntax. Hope it's correct.
Rgds
N
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