Forum Discussion

Brent_J's avatar
Brent_J
Icon for Nimbostratus rankNimbostratus
Nov 17, 2015

Query GTM supplying Client IP address from LTM

Hi, I have an problem with GTM wideIP geolocation.

 

Problem statement: I need to send clients to specific VIPs in Geo distinct datacenters based on the client IP.

 

In my country all ISP DNS resolvers appear to be in the located in one city. This makes my WIDEIP Geolocation database next to useless as all in-country requests appear to come from the same place.

 

I haven't come across any irule function yet which allows me to query the GTM WIDE IP using the client IP address. The client address is only first available to me once the client has arrived at my APM VIP. So my options are:

 

1:/ write a irule with datagroups containing all my local geolocation info and do a redirect to the closest VIP however however that wouldn't allow me to know the health of the VIPs being redirected.

 

2:/ Somehow query the GTM using the clients IP and then redirect the client based on the GTM response. This should return the closest VIP which is available.

 

Any irule experts out there with a solution for option2 ?

 

Many thanks in advance.

 

B

 

2 Replies

  • Option 2 is not an option, standard DNS function means requests will always come from a Recursive DNS server and never directly from the client.

    Option 1 would need an iRule to use the 'whereis' iRule feature see the following example:

    when HTTP_REQUEST {
        switch [string tolower [whereis [IP::client_addr] abbrev] {
              "af" -
              "bh" -
              "bd" -
              "be" -
              "eg" -
              "fr" -
              "de" -
              "in" -
              "ir" -
              "iq" -
              "it" -
              "jo" -
              "kz" -
              "ke" -
              "kw" -
              "lb" -
              "mo" -
              "np" -
              "nl" -
              "om" -
              "pk" -
              "qa" -
              "ru" -
              "sa" -
              "es" -
              "lk" -
              "sd" -
              "sz" -
              "sy" -
              "tn" -
              "tr" -
              "ua" -
              "ae" -
              "ye" {
                  HTTP::redirect "http://www.example.com/home-${country}"
             } 
              default {
                    Redirect all others
                   HTTP::redirect "http://www.example.com/home"
                }
           }
    }
    
  • Thanks AMG. I'm not concerned so much about the countries, it's my local users whom I wish to identify and send to their local DC. I have all the subnet definitions defining my local users locations already configured in my GTM config so was hoping I didn't have to duplicate.

     

    Is there not a way to query the GTM datacentre topology definition from a LTM instance?

     

    I guess I could define a bunch of different WIDEIP's one for each DC with a priority group and then duplicate the DC definitions into Datagroups on each LTM. It will be bit messy and a pain to administer however it would work. Was just hoping there was a more elegant method.

     

    Thanks