source based pool selection (irule not working)

Hello all , i am trying to creat an irule for source address based pool selection but irule is not working.

please check the syntex

---------------------------------------------

when CLIENT_ACCEPTED {

if { [IP::addr [IP::client_addr] equals 10.113.0.0/16] } {

pool Outbound-Voice-Video

} elseif { [IP::addr [IP::client_addr] equals 203.128.0.0/24] } {

pool Outbound-Public-Servers

} elseif { [IP::addr [IP::client_addr] equals 203.128.1.0/24] } {

pool Outbound-Public-Servers

} elseif { [IP::addr [IP::client_addr] equals 203.128.4.226/24] } {

pool Outbound-Public-DMZ

}

}

------------------------------------------------

The syntax looks fine. You don’t have a default case specified if the client IP doesn’t match any of the rule conditions. Do you have a default pool configured on the VIP?

What’s not working? Can you add logging to the rule to verify the client IP the BIG-IP receives is what you’re expecting?

Here is an example:

when CLIENT_ACCEPTED {
   log local0. "Client: [IP::client_addr]"
   if {[IP::addr [client_addr] equals 192.168.99.0/24]}{
      log local0. "Matched: 192.168.99.0/24"
   } else {  
      log local0. "Didn't match: 192.168.99.0/24"
   }  
}

Log output:

: Client: 192.168.99.37

: Matched 192.168.99.0/24

Aaron