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...
Neil_66348
Nov 09, 2010Nimbostratus
Hi ,
Arrggg , didn't notice that one on using abbrev...great thanks
Testing with an iRule from the article works fine:
when CLIENT_ACCEPTED { if { !(([whereis [IP::client_addr] state] equals "York") or ([whereis [IP::client_addr] state] equals "Leeds")) } { pool TIN-HTTP-POOL }}
So , I think this leads onto another problem with potentially it using the Data List lookup from the if and the switch $state
when HTTP_REQUEST {
set state [class match -value [whereis [IP::client_addr] state] equals uk_regions]
if {$state ne ""}{
switch $state {
"Greater London" {HTTP::redirect "http://62.190.x.c/ab/grlon/"}
"Leeds" {HTTP::redirect "http://62.190.x.x/ab/leeds"}
"York" {HTTP::redirect "http://62.190.x.x/ab/York/"}
default {pool TIN-HTTP-POOL}
}
}
}
Changing the data list type from string to integer reveals:
- bad IP network address formatInvalid class element York for class uk_region invoked from within "class match -value [whereis [IP::client_addr] state] equals uk_region"
So clearly it has to be string , but crucially shows that the first part is functioning in terms of finding the "state" in the first place just now an issue with the element for the lookup to that list...
Thanks
Neil
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