Forum Discussion
Anish_Srivastav
Nimbostratus
Dec 16, 2010GeoIP-Quova header help
Greetings!
I want to have a custom generated HTTP header i.e. HTTP_X_FORWARDED_GEO which will hold the value "EU" for any country in the European union i.e. if [whereis [IP::client_addr] country] is FR,GB,ES etc then HTTP_X_FORWARDED_GEO = EU else it will be US or NULL value.
Can someone please help me in achieving this using an iRule or any other method which can work?
Thanks in advance
Anish
3 Replies
- hoolio
Cirrostratus
Hi Anish,
You can use an iRule like this to look up the country for a client IP and insert it into a header:when CLIENT_ACCEPTED { Look up the client IP in the GeoIP database and get the country set country [whereis [IP:client_addr] country] For EU countries, set the value to EU switch $country { "FR" - "GB" - "ES" - "IE" { For these countries, set the country to EU set country "EU" } } } when HTTP_REQUEST { Replace (or insert if not there already) the country in a custom header HTTP::header replace HTTP_X_FORWARDED_GEO value $country }
Aaron - hoolio
Cirrostratus
Hi Anish,
After reading some internal docs, I think that the EULA for Quova's GeoIP data restricts any type of use where the GeoIP info is passed off of LTM. So to follow the licensing for Quova data on LTM, you couldn't use the above iRule or any other that transmits the GeoIP data to non-LTM hosts.
If you want more info on this, you could contact your local F5 SE or partner.
Sorry for any confusion,
Aaron - Anish_Srivastav
Nimbostratus
Thanks! Aaron
I will take this up with my F5 partner
Regards
Anish
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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