Forum Discussion

Andy_Smith_2380's avatar
Andy_Smith_2380
Icon for Nimbostratus rankNimbostratus
Nov 22, 2006

iRules and source IPs - GTM

Hi,

 

 

Not sure if anyone can help me here, as this relates to GTM as opposed to Big-IP, but I'll give it a go...

 

 

Basically, I'm trying to write an iRule to loadbalance requests to different wideip pools based on the source. I've seen that you can do this based on the source IP, but there doesn't appear to be a way to do it based on a range of source IPs.

 

 

Is there a way?

 

 

Andy.

2 Replies

  • You can make use of netmasks or netmask shorthand notations in your address comparisons.

    Something like this should work

    if {[IP::addr [IP::remote_addr]/24 equals "172.19.10.0"]} {
      LB:reselect snat none
    }

    This will compare the address in IP::remote_addr to see if it is in the 172.19.10.* network.

    If you want to do something like "if addr greater than addr1 and less than addr2) then you'll probably have to do the math to convert the ip address to it's number equivalent and then do the math comparisons.

    -Joe