Forum Discussion
CGI
Altostratus
Nov 16, 2010Combining geofiltering and uri filter
Hi we have a irule today that is below;this rule was created with help from this forum, i now need to be able to send traffic that reequests a certain url
IRULE:-
when CLIENT_ACCEPTED {
if {([class match [whereis [IP::client_addr] country] eq allowed_country] or [class match [IP::client_addr] eq allowed_ip])} {
set allowed 1 }
else { set allowed 0 }}
when HTTP_REQUEST {
if { $allowed eq 1 } {
Uncomment the line below to turn on logging.
log local0. "Valid client IP: [IP::client_addr]"
}
else {
HTTP::respond 403 content "The country or IP is not allowed to access this site"
log local0. "Blocked Country client IP: [IP::client_addr] from [whereis [IP::client_addr] country]" } }
such as http://at.nowhere.com/corp and comes from the UK to a different pool than those from Ireland.
Whats the best way to do this as regards both perofrmance and optimisation.
Any help greatly appreciated.
/Regards Craigg
1 Reply
- hoolio
Cirrostratus
Hi Craigg,
If you're going to check a lot of URIs (or most of the HTTP requests that come into the VS will be checked for client IP GeoIP info) it would make sense to look up all client IP's once in CLIENT_ACCEPTED and then check the URI in HTTP_REQUEST. You could then select a pool based on GeoIP info and requested URI in HTTP_REQUEST.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
