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_REQUEST {
if { not( [ matchclass [IP::client_addr] equals $::Datagroup1]) or not ([ matchclass [ IP::client_addr] equals $::datagroup2 ) } {
log "blocked request for [HTTP::uri] by [IP::client_addr]"
HTTP::redirect "http://redirectURL.com/"
return
}
}
It looks like the IPs that match Datagroup1 work, but not Datagroup2. Can someone help me with my syntax? Probably so easy for the gurus out there, but it's driving me nuts! LOL. Thanks again.