Forum Discussion
JB_106099
Nimbostratus
Apr 02, 2012Conditional Irule
I am new to irules and I need some assistance on writing an irule that will allow my local subnets to a uri that contains a specific string but will drop all external connections and also send...
Michael_Yates
Nimbostratus
Apr 02, 2012Hi JB,
What Sashi told you should work fine, but if you wanted to change the order of things you could save yourself a few cycles by not doing an IP Address compare and a Query inspection for every request.
You could search for the Query Value and if it matches then do the IP Address lookup.
v10.x.xwhen HTTP_REQUEST {
if { [HTTP::query] contains "arch" } {
if { !([class match [IP::client_addr] equals internal_subnets]) } {
HTTP::respond 403 content "Forbidden"
}
}
} v9.x.xwhen HTTP_REQUEST {if { [HTTP::query] contains "arch" } {if { !([matchclass [IP::client_addr] equals $::internal_subnets]) } {HTTP::respond 403 content "Forbidden"}}} Just another option.
Hope this helps.
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