iRule to match IP subnet in a routing domain
I need an iRule that matches a network subnet that is also a routing domain. In human terms, I need to match this:
10.15.115.0%1/24
Currently I am using this code and it works, but I want to be more precise:
if {[IP::client_addr] contains "10.15.115."}
I was not able to get this to work:
if {[class match [IP::client_addr] equals "10.15.115.0%1/24"]}
If I use "log local0." to write the client IP address to the log, I definitely see the %1 after the client IP addresses so I know I have the correct routing domain.
Any ideas?
Also, a small additional question: This same iRule is enabling setting "snat automap" or "snat none" based on the client IP. Do I also need to set the pool (or any other things) in the iRule, if the pool is already configured in the virtual server? The pool is the same regardless of the client IP so I don't need to change it. I'd like to leave the pool out of the iRule so I can use the same iRule with other virtual servers.