Forum Discussion
monstaloc_63499
May 10, 2012Nimbostratus
Please help with Not and OR
Hey everyone, first post, not my first iRule, but not my millionth either.
I'm trying to say, if the source IP is not listed in Datagroup1, OR datagroup2, redirect.
when HTTP_REQU...
Joel_Moses
May 11, 2012Nimbostratus
Okay. You can certainly use the "matchclass" command do do this, but the better command to use is just "class". And when you're doing your comparison, you can group everything in the "not". Something like this:
when HTTP_REQUEST {
if { not ([class match [IP::client_addr] equals $::Datagroup1] || [class match [IP::client_addr] equals $::datagroup2]) } {
log "blocked request for [HTTP::uri] by [IP::client_addr]"
HTTP::redirect "http://redirectURL.com/"
return
}
}
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