Forum Discussion
Demeter_Luo
Nov 08, 2016Nimbostratus
Geo-location can be LTM moudle outbound irules use?
Hi Everyone
I have a LTM combo GTM divice.
I hope use Geolocation IP databse in Ltm Outbound iRules.
But I test may not be able to use.
Thanks
D.Luo
The_Bhattman
Nov 08, 2016Nimbostratus
Here is an IRULE that uses the GTM and Google Maps
when HTTP_REQUEST {
set ip [URI::query [HTTP::uri] ip]
set response "\n \n IP Address Geolocation Data Search\n \n \n"
if { ![catch {IP::addr $ip mask 255.255.255.255} ] } {
set geo_properties { country state city zip isp org }
append response "
IP Address Geolocation Data Search
IP
$ip
\n"
foreach property $geo_properties {
set result [whereis $ip $property]
if { $result ne "" } {
append response "
[string toupper $property]
[string toupper $result]
\n"
}
}
append response " \n"
set latitude [whereis $ip latitude]
set longitude [whereis $ip longitude]
if { ($latitude != 0) && ($longitude != 0) } {
append response " \n \n \n lat: $latitude, long: $longitude\n"
} else {
append response " \n \n"
}
append response " "
} else {
append response {
IP Address Geolocation Data Search
IP:
}
}
append response "\n \n"
HTTP::respond 200 content $response
}
I hope this helps, The Bhattman
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