Forum Discussion

Eric_Chung_1045's avatar
Eric_Chung_1045
Icon for Nimbostratus rankNimbostratus
Dec 13, 2006

Restrict specific IPs to specific URI

I am now studying a configuration to allow specific client IP to access specific URI under the same URL and I have drafted the configuration below:

 

 

if (http_host == "www.abc.com") {

 

if (http_uri starts_with "/AAA/Production"

 

or http_uri starts_with "/AAA/Current/"

 

or http_uri starts_with "/AAA/Doc/"

 

or http_uri starts_with "/AAA/help"

 

or http_uri starts_with "/AAA/up/") {

 

use pool weblogicHTTPS8011

 

}

 

elseif (http_uri starts_with "/testing/testing.jsp" ) {

 

if (client_addr == "xxx.xxx.xxx.xxx"

 

or client_addr == "xxx.xxx.xxx.xxx"

 

or client_addr == "xxx.xxx.xxx.xxx"

 

or client_addr == "xxx.xxx.xxx.xxx"

 

or client_addr == "xxx.xxx.xxx.xxx"

 

or client_addr == "xxx.xxx.xxx.xxx"

 

or client_addr == "xxx.xxx.xxx.xxx"

 

or client_addr == "xxx.xxx.xxx.xxx"

 

or client_addr == "xxx.xxx.xxx.xxx"

 

or client_addr == "xxx.xxx.xxx.xxx"

 

or client_addr == "xxx.xxx.xxx.xxx") {

 

use pool weblogicHTTPS8011

 

}

 

else {

 

log "client" + client_addr + ";" + client_port + http_uri + "denied"

 

discard

 

}

 

}

 

else {

 

log "client" + client_addr + ":" + client_port + http_uri + "denied"

 

discard

 

}

 

}

 

else {

 

log "client" + client_addr + ":" + client_port + http_uri + "denied"

 

discard

 

}

 

 

I use the iRule Editor to generate this configuration. However, the BIGIP we are using is 4.6.2.

 

 

As the BIGIP is in production, can anyone help me to check whether the configuration is matched with v4.6.2? Thanks.

 

 

Regards,

 

Eric HK Chung

1 Reply

  • Hi Eric,

     

     

    You could simplify the rule by using classes for the URIs and client IP addresses. Check this recent post of mmac's for an example (Click here)

     

     

    To test the rule, without affecting production traffic, you could set up a test VIP that references the rule and the same pools.

     

     

    Aaron