Forum Discussion

bwagner444_1277's avatar
bwagner444_1277
Icon for Nimbostratus rankNimbostratus
May 25, 2007

Source based routing to multiple groups

This one is pretty straight forward jus tnot sure if I am using correct syntax or the proper use of a possible "or". Any help would be great...

 

 

Well so here we go. I have a requirement as follows :

 

 

If client destined to www.blah.com from 10.20.30.0/24 or 10.20.32.0/24 the traffic need to be sent to server groupA.

 

If client destined to www.blah.com from 10.20.33.0/24 the traffic needs to be sent to server group B.

 

All other clients destined to www.blah.com unless matching before mentioned sources go to server group C.

 

 

This is what I have come up with so far.

 

 

when CLIENT_ACCEPTED { if {[IP::addr "[IP::client_addr]/24" equals "10.20.30.0"]} { pool groupA_pool } { if {[IP::addr "[IP::client_addr]/24" equals "10.20.32.0"]} { pool groupA_pool } { if {[IP::addr "[IP::client_addr]/24" equals "10.20.33.0"]} { pool groupB_pool } else { pool groupC_pool }}

1 Reply

  • That looks good with some minor edits. You can use 'or' to or the two tests together. And I'd use elseif's to ensure that you're only checking one condition if the previous test(s) failed. Lastly, you don't need to the quotes. Can you try testing this?

    
    when CLIENT_ACCEPTED {
       if {[IP::addr [IP::client_addr]/24 equals 10.20.30.0] or [IP::addr [IP::client_addr]/24 equals 10.20.32.0]}{ 
          pool groupA_pool
       } elseif {[IP::addr [IP::client_addr]/24 equals 10.20.33.0]}{
          pool groupB_pool
       } else { 
          pool groupC_pool
       }
    }

    Aaron