For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

F5SJ_'s avatar
F5SJ_
Icon for Altocumulus rankAltocumulus
Aug 28, 2020

irule to redirect traffic to multiple pools

All,

 

We have one vip which is redirecting traffic to multiple pools via irule.

 

rule:

 

when CLIENT_ACCEPTED {

    if { [class match [IP::client_addr] equals xxxx] } {

        pool xxxx

    } elseif { [class match [IP::client_addr] equals zzzz] } {

        pool zzzz

    } elseif { [class match [IP::client_addr] equals yyyy] } {

        pool yyyy

    } else {

        #log local0. "Default pool (drop): [IP::client_addr]-->[LB::server]" 

        drop

    }

 

}

 

All pools have same pool member (IP) but ports are different. Now we need to add one more pool member not as a load balancing but it will receive traffic at a same time.

 

I have prepared one irule for that:

 

when CLIENT_ACCEPTED {

    if { [class match [IP::client_addr] equals test_1234] } {

         pool test

pool test2

    } else {

        #log local0. "Default pool (drop): [IP::client_addr]-->[LB::server]" 

        drop

    }

 

}

 

But I am not seeing traffic in both the pools. Could someone check the code and let me know the correct way to do this.