Forum Discussion

jondyke_46152's avatar
jondyke_46152
Icon for Nimbostratus rankNimbostratus
Jun 26, 2008

Access Control Based On IP for specific URL

I am pretty new to irules so any help here would be appeciated. The irule below is the deafult irule for Access control based on IP from the codeshare area. Is it possible to alter this so that it controls access for a specific URL under the virtual server rather than the whole virtual server? ie. http://www.joeblogs.com/restricted/

 

 

when RULE_INIT {

 

v1.0 - basic ACL.

 

October, 2007

 

Tested on BigIP version 9.4.

 

 

Purpose:

 

Bind this rule to a network virtual server to simply allow or disallow traffic based on source IP.

 

This rule expects a datagroup named trustedAddresses that lists the addresses you wish to allow.

 

By default, traffic will be dropped.

 

}

 

when CLIENT_ACCEPTED {

 

 

if { [matchclass [IP::client_addr] equals $::trustedAddresses] }{

 

 

Uncomment the line below to turn on logging.

 

log local0. "Valid client IP: [IP::client_addr] - forwarding traffic"

 

forward

 

} else {

 

 

Uncomment the line below to turn on logging.

 

log local0. "Invalid client IP: [IP::client_addr] - discarding"

 

discard

 

}

 

 

}

 

 

24 Replies