Forum Discussion
Wil_Schultz_101
Nimbostratus
Jul 02, 2007My iRule stopped working?!
I've got an irule that (to the best of my knowledge anyway) has been working for quite some time, for some strange reason part of it stopped working yesterday. Here is what it looks like:
when HTTP_REQUEST {
if { [matchclass [IP::remote_addr] equals $::private_net] } {
use pool my_pool
}
switch -glob [string tolower [HTTP::uri]] {
}
default {
pool myother_pool
}
}
}
In the class private_net I have defined: 192.168.0.0 / 255.255.0.0
I set up a logging trap and put it at the end of the switch:
default {
set remoteip [IP::remote_addr]
log local0. "my.com, $remoteip"
pool myother_pool
}
And receive the following in my log:
Jul 2 14:28:30 tmm tmm[1026]: Rule my : my.com, 192.168.22.57
Can anyone shed some light on this? This is a security feature I have set up which is bypassed at the moment.
- Deb_Allen_18Historic F5 AccountI think you may have been caught by a common misperception: The "pool" command in v9 doesn't terminate request processing and send the traffic immediately to the pool as it did in v4.
- Wil_Schultz_101
Nimbostratus
Interesting.... I could have sworn that this worked in the past. - Wil_Schultz_101
Nimbostratus
Posted By wschultz on 07/02/2007 4:20 PM
when HTTP_REQUEST { if { [matchclass [IP::remote_addr] equals $::private_net] } { use pool my_pool } elseif { [HTTP::uri] starts_with "/" } { switch -glob [string tolower [HTTP::uri]] { } default { pool myother_pool } } } }
- Wil_Schultz_101
Nimbostratus
Posted By wschultz on 07/02/2007 4:28 PM
Posted By wschultz on 07/02/2007 4:20 PM
when HTTP_REQUEST { if { [matchclass [IP::remote_addr] equals $::private_net] } { use pool my_pool } elseif { [HTTP::uri] starts_with "/" } { switch -glob [string tolower [HTTP::uri]] { } default { pool myother_pool } } } }
when HTTP_REQUEST { if { [matchclass [IP::remote_addr] equals $::private_net] } { use pool my_pool } elseif {! [matchclass [IP::remote_addr] equals $::private_net] } { switch -glob [string tolower [HTTP::uri]] { } default { pool myother_pool } } } }
- Deb_Allen_18Historic F5 AccountLogging will help you see what's going on.
when HTTP_REQUEST { if {[matchclass [IP::remote_addr] == $::private_net]}{ log local0. "Matched on client IP [IP::remote_addr]" pool my_pool } else { log local0. "No match on client IP [IP::remote_addr]" pool myother_pool } }
- Deb_Allen_18Historic F5 AccountThe tcl "return" command will cause an exit from the calling event. (In this case, would end processing of HTTP_REQUEST when called.)
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