Forum Discussion

Roy_Jee's avatar
Roy_Jee
Icon for Nimbostratus rankNimbostratus
Aug 19, 2019

Irule to differentiate source traffic

Hi Folks,

i have an issue regarding source traffic please assist.

Scenario:

VIP:10.10.50.100

Pool members :10.10.30.100 , 10.10.30.101

when traffic from user having last octet of ip in even number e.g 192.168.150.100 come it will go to 10.10.30.100 and when traffic from user having last octet of ip address in odd number e.g 192.168.150.101 come it will routed to 10.10.30.101.is it possible ?

Many Thanks .

2 Replies

  • Hello Roy.

     

    This iRule should do the same you are looking for.

    https://devcentral.f5.com/s/question/0D51T00006i7jQNSAY/oddeven-ip-address-irule

     

    KR,

    Dario.

  • when HTTP_REQUEST {
    	switch -glob [IP::client_addr] {
    		"*1" -
    		"*3" -
    		"*5" -
    		"*7" -
    		"*9" { node "nodeName_10.10.30.101" }
    		default { node "nodeName_10.10.30.100" }
    	}
    }