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 a response code 403 to these dropped connections.
Data group defined "internal_subnets"
string in uri "?arch" on which rule is to apply.
Any assiatance would be greatly appreaciated.
JB
- Sashi_81625
Nimbostratus
when HTTP_REQUEST { - JB_106099
Nimbostratus
Hi Sashi, - Sashi_81625
Nimbostratus
ok, u cant use class on v9. use matchclass instead - Michael_Yates
Nimbostratus
Hi JB,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"}}}
- JB_106099
Nimbostratus
Thank You, I will test both of these options out tonight and update tomorrow. - JB_106099
Nimbostratus
Sashi and Michael,
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