Forum Discussion

cxcal_18687's avatar
cxcal_18687
Icon for Nimbostratus rankNimbostratus
Oct 21, 2008

converting 4.x iRule

I recently did a conversion from 4.x to 9.3.1 and all of the iRules came over clean (that I can tell so far).

 

 

but there was one iRule that I'm having issues with:

 

 

if (not client_addr == 192.168.13.1 and not client_addr == 192.168.13.2) {

 

discard

 

}

 

else {

 

use pool Int_HTTPS

 

}

 

 

 

Any ideas on converting this one??

1 Reply

  • Hi,

    You can use IP::client_addr (Click here) to get the client IP address. And you can use the IP::addr command (Click here) to evaluate one IP or subnet against another.

     
     when CLIENT_ACCEPTED { 
      
         Check if client IP is 192.168.12.1 or .2 
        if {[IP::addr [IP::client_addr] equals 192.168.12.1] or [IP::addr [IP::client_addr] equals 192.168.12.2]}{ 
      
            use the HTTPS pool 
           pool Ing_HTTPS 
      
        } else { 
      
            Drop the request 
           discard 
        } 
     } 
     

    Aaron