Forum Discussion
"bad IP address format" errors when using geolocation iRule
Thanks nitass for the recommended approach - the rule is now working without any errors. F5 also gave a nice hint to use the return command to ensure that the iRule processing stops as soon as a condition is met. They already saw cases where the iRule ran into errors when not using the command.
when HTTP_REQUEST {
if { [HTTP::header exists "True-Client-IP"] } { set True_Client_IP "[HTTP::header "True-Client-IP"]%1" } else { set True_Client_IP [IP::client_addr] }
if { (([whereis [IP::client_addr] country] equals "US") or ([whereis [IP::client_addr] country] equals "CA") or ([whereis [string tolower $True_Client_IP] country] equals "US") or ([whereis [string tolower $True_Client_IP] country] equals "CA")) } { if { [HTTP::uri] contains "?"}{ HTTP::uri "[HTTP::uri]&isCountryEMD=yes" pool pool_ebiz_prod_443 return } else { HTTP::uri "[HTTP::uri]?isCountryEMD=yes" pool pool_ebiz_prod_443 return } } }
Recent Discussions
Related Content
* 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