Forum Discussion

maruf_58474's avatar
maruf_58474
Icon for Nimbostratus rankNimbostratus
Mar 05, 2009

How to redirect to an ASM class with Irule

I am trying to use irule to send traffic to an ASM class, how do i do that? I am using version 9.4.6

 

 

I am trying something like

 

 

if IP equal x.x.x.x

 

send to a_pool

 

else send to ASM class

 

 

 

 

Could anyone help?

 

 

thanks

1 Reply

  • There is an existing request to add support for using source IP address/network as one of the filters on an HTTP class. This would allow you to configure your scenario without using an iRule. If you open a case with F5 Support you could get your request attached to the existing feature request.

    In the meantime, you can use an iRule like this. The iRule assumes you already have the HTTP class added to the VIP with no filters. By default all traffic is sent to ASM and then the pool on the class or the pool on the VIP. Only requests from 1.1.1.1 are sent directly to my_pool.

     
     when HTTP_CLASS_SELECTED { 
      
         Check if client IP address is 1.1.1.1 
        if {[IP::addr [IP::client_addr] equals 1.1.1.1]}{ 
      
            Disable ASM for this client 
           PLUGIN::disable ASM 
      
            Send request to a different pool than the VIP's default pool 
           pool my_pool 
        } 
     } 
     

    Aaron