Forum Discussion
DarkSideOfTheQ_
Nimbostratus
Sep 16, 2009Restrict access based off source network
Hello All,
Sanity check...I'm trying to block access to specific pages based off the source network the client is coming from. The rest of the site should remain available to anyone. I *think...
hoolio
Cirrostratus
Sep 17, 2009This line was just for debugging of all requests:
log local0. "[IP::client_addr]:[TCP::local_port]: Request to [HTTP::uri] with dg: $::ips_internal"
If you want to use a switch statement you can use something like this:
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"*Test.jsp*" -
"*Stats.jsp*" {
if {not [matchclass [IP::client_addr] equals $::ips_internal]} {
log local0. "[IP::client_addr]:[TCP::local_port]: Matched IP check. Discarding request to [HTTP::uri]"
discard
}
}
}
}
Note the use of the asterisks for wildcard (glob) matching.
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
