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

Nuruddin_Ahmed_'s avatar
Nuruddin_Ahmed_
Icon for Cirrostratus rankCirrostratus
Aug 01, 2016

i rule for traffic redirection

Hi,

 

I need your help in writing on irule -

 

if the request is coming from x.x.x.x and y.y.y.y and z.z.z.z then go to pool A Else go to Virtual server B

 

Thanks.

 

6 Replies

  • Hi,

    You can use the following irule or an ltm policy (http traffic) :

        when CLIENT_ACCEPTED {
            if { [class match [IP::client_addr] POOL_A_IPS] } {
                pool pool_a
            } else {
                virtual virtual_server_b
            }
        }
    

    POOL_A_IPS is a datagroup containing your IP addresses x.x.x.x, y.y.y.y and z.z.z.z

    • Yann_Desmarest's avatar
      Yann_Desmarest
      Icon for Cirrus rankCirrus

      You can also change the Event context for http traffic for example :

      when HTTP_REQUEST {
          if { [class match [IP::client_addr] POOL_A_IPS] } {
              pool pool_a
          } else {
              virtual virtual_server_b
          }
      }
      
    • Nuruddin_Ahmed_'s avatar
      Nuruddin_Ahmed_
      Icon for Cirrostratus rankCirrostratus

      Hi Yann,

       

      You have been great help for many of my queries. I would test this one and update if it works.

       

      Thanks

       

  • Hi,

    You can use the following irule or an ltm policy (http traffic) :

        when CLIENT_ACCEPTED {
            if { [class match [IP::client_addr] POOL_A_IPS] } {
                pool pool_a
            } else {
                virtual virtual_server_b
            }
        }
    

    POOL_A_IPS is a datagroup containing your IP addresses x.x.x.x, y.y.y.y and z.z.z.z

    • Yann_Desmarest_'s avatar
      Yann_Desmarest_
      Icon for Nacreous rankNacreous

      You can also change the Event context for http traffic for example :

      when HTTP_REQUEST {
          if { [class match [IP::client_addr] POOL_A_IPS] } {
              pool pool_a
          } else {
              virtual virtual_server_b
          }
      }
      
    • Nuruddin_Ahmed_'s avatar
      Nuruddin_Ahmed_
      Icon for Cirrostratus rankCirrostratus

      Hi Yann,

       

      You have been great help for many of my queries. I would test this one and update if it works.

       

      Thanks