Forum Discussion
SighclopsII_189
Nimbostratus
Feb 25, 2015iRule to allow access to a uri only from a specific source subnet
I am looking to create an iRule that will allow access to uri's containing specifics when coming from an approved subnet but dropping requests to those uri's when coming from all other subnets.
...
Michael_Jenkins
Cirrostratus
Feb 25, 2015This wiki page talks about checking ip addresses.
Basically, the irule you're looking for would be similar to this. You should be able to change it up as necessary.
when HTTP_REQUEST {
The switch statement is good for conditionals and easy to manage.
The '-glob' parameter marks the switch to allow wildcards (the "*")
switch -glob -- [string tolower [HTTP::uri]] {
"/something/test/testing" {
if { [IP::addr [IP::client_addr] equals 10.1.1.0/24] } {
Process the traffic
pool POOL_NAME
} else {
Drop the connection (you can also use reject instead of drop)
drop
}
}
}
}
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