Forum Discussion
tnastars_92934
Nimbostratus
Feb 02, 2010Help With IRule to limit access via an address data group
Hello,
I have created the below iRule. I am trying to limit access to a URL based on a specific URI, but allow all traffic to any other URI going to the virtual server. My main question is how to I specify what pool of address to send the traffic to? I think this will work if I can leave a default Pool on the virtual server as well as an iRule. Is that possible? If not is there code I can add to my iRule to specify the pool I wish to send traffic to?
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/Foo/"} {
if { not [matchclass [IP::client_addr] equals $::Foo_IPs] } {
HTTP::respond 403 content "403 - Forbidden" }
}
}
- hoolio
Cirrostratus
If you don't specify a pool for any case in the iRule, the VIP's default pool will be used for requests you don't send a response to from the iRule. - tnastars_92934
Nimbostratus
Hoolio, - tnastars_92934
Nimbostratus
Sorry Hoolio I copied an old version of my iRule above. Is this what you are suggesting I should do: - hoolio
Cirrostratus
That should work to send all traffic you don't send an HTTP response to from the iRule to the VIP's default pool. - tnastars_92934
Nimbostratus
Aaron, - hoolio
Cirrostratus
Hi Tom,when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] to [HTTP::host][HTTP::uri]" if { [HTTP::path] starts_with "/foo/"} { log local0. "[IP::client_addr]:[TCP::client_port]: Matched path check" if { not [matchclass [IP::client_addr] equals $::foo_IP]} { log local0. "[IP::client_addr]:[TCP::client_port]: Blocking request" HTTP::respond 403 content "403 - Forbidden" } } }
- tnastars_92934
Nimbostratus
Aaron,
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