Forum Discussion

AaronMLong_1021's avatar
Jun 14, 2012

Class Match iRule problem

So I'm writing a simple dust page rule, which I want to make a few exceptions based on source address. I used to have a if/then/else nightmare in 9.4.4, so I'm not sorry to revisit the issue, but the class match syntax is still evading me, I think. Either that or there's some other screwup in here I'm missing:


when HTTP_REQUEST {
   if { [class match [IP::client_addr] equals 
"AWS_EC2"] } {
       Allow Amazon EC2 nodes past DUST Page
   } elseif 
{ [class match [IP::client_addr] equals "Testers"] } {
       Allow Testers 
past DUST Page
   } else {
      HTTP::redirect 
"URL"
   }
}

My data groups are entered using the Data Group Editor in the F5 iRule Editor, under Addresses. When I access from an IP listed in my class match clauses, I still get redirected to URL. What am I screwing up?

12 Replies