Forum Discussion
Neil_66348
Nov 09, 2010Nimbostratus
iRule GeoIP Targeting
Hi Guys ,
We're looking to implement some targeting thats found in 10.2 on our F5's.
Performing matching at the IP level works fine , I've found some example code for matching to t...
naladar_65658
Nov 09, 2010Altostratus
Hey Neil,
I have to preface this with the fact that I am not really good at iRules, but here is what I came up with. Give it a shot and see what you get, it at least compiles on my BIG-IP:
when HTTP_REQUEST {
set region [class match -value [whereis [IP::client_addr] abbrev] equals uk_regions]
if {$region ne ""}{
switch $region {
"York" { pool $region }
"Greater London" {HTTP::redirect http://dev.application.com/grlondon}
"Leeds" {HTTP::redirect http://dev.application.com/leeds}
"Stockport" {HTTP::redirect http://dev.application.com/stockport}
default {pool devpool}
}
}
}
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