Forum Discussion
ChristerB_10333
Feb 23, 2011Nimbostratus
Blocking a country and sending request to a pool
Hi!
I'm currently blocking some countries with an iRule using Geolocation and a data group list.
The iRule looks like this
when HTTP_REQUEST {
if { [matchcla...
hooleylist
Feb 23, 2011Cirrostratus
Hi Christer,
Yes, you can replace the HTTP::redirect with a pool statement.
For 9.4.4+ make sure to reference datagroups without the $:: or :: prefix. Else, the lookup will fail in 10.x. Also, you can replace matchchlass with class:
when CLIENT_ACCEPTED {
Check once per TCP connection if the country for the client IP is in the blocked country datagroup
if { [class match [whereis [IP::client_addr] country] eq blocked_countries] } {
pool blocked_pool
} else {
pool [LB::server pool]
}
}
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