Piyush_72418
Feb 24, 2009Nimbostratus
check
If I have a Geo IP based domain resolution @ DNS.
like based on Geo location abc.com will be resolved to either a.b.c.d (if US) and e.f.g.h (if from India)
Can I write a iRule on BigIP...
Yes this is possible, but it would be more or less looking up the known addresses found on the GEO-IP
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals a.b.c.d/8] } {
HTTP::redirect "http://abc.com/home_us.html"
} elseif {[IP::addr [IP::client_addr] equals e.f.g.h/8] } {
HTTP::redirect "http://abc.com/home_in.html"
}
}
Of if you have multiple address blocks within India and USA (which you will) then you I suggest using class objects
class usa{
a.b.c.d 255.255.0.0
m.n.o.p 255.0.0.0
}
class india {
e.f.g.h 255.255.0.0
i.j.k.l 255.0.0.0
}
when CLIENT_ACCEPTED {
if { [matchclass [IP::client_addr] equals $::usa] } {
HTTP::redirect "http://abc.com/home_us.html"
} elseif {[matchclass [IP::client_addr] equals $::india] } {
HTTP::redirect "http://abc.com/home_in.html"
}
}
Hope this helps
CB