Forum Discussion

Saib_175162's avatar
Saib_175162
Icon for Nimbostratus rankNimbostratus
Oct 26, 2014

Irule Request

Hi,

 

I have a Big IP LTM 3600. I want to build an irule with the following requirements,

 

1- Allow IPs only from America and India. 2- Allow only certain IP addresses from India 3- Allow 10.0.0.0/8 for access from inside 4- Disallow everything else.

 

Any help would be highly appreciated.

 

Thanks, Maz

 

2 Replies

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    I'm not sure how allowing Indian IP-addresses (requirement 1) correlates to 2 (allow only certain addresses from India), so I've split them up.

    1) & 3) & 4)

    when HTTP_REQUEST {
    
        if { [whereis [IP::client_addr] country] equals "US" || [whereis [IP::client_addr] country] equals "IN" || [IP::addr [IP::client_addr] equals 10.0.0.0/8]} {
    
            iRule functionality here
    
        } else {
    
            reject
    
        }
    
    }
    

    2) Create a data class "class_IndiaIpWhitelist" for this that contains the IP-addresses you want to allow.

    when HTTP_REQUEST {
    
        if { [class match [IP::client_addr] equals class_IndiaIpWhitelist] {
    
            iRule functionality here
    
        } else {
    
            reject
    
        }
    
    }