Forum Discussion
jona187_168823
Nimbostratus
Mar 04, 2015iRule to set country code for IP
I need help setting the country code for a specific IP to test out website functionality
I want to create an irule to set the country code to a specific country, fo ex like CN
What is the k...
Michael_Jenkins
Cirrostratus
Mar 09, 2015I'm pretty sure that the whereis function is read-only, so you can't do any kind of setting the value. Based on your original question of wanting to test, then your best bet may be to just use a variable and set it manually
when HTTP_REQUEST {
if {[IP::client_addr] == "Your.IP.Address"} {
set country "CN"
} else {
set country [whereis [IP::client_addr] country]
}
For verification, tail /var/log/ltm as you implement the changes
log local0. "IP: [IP::client_addr]; Country Code: $country"
Geo-location iRule continues...
Use the "$country" variable instead of "whereis" from now on.
}
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
