Forum Discussion
Aurel
Cirrus
Mar 31, 2016HTTP_REQUEST - invalid command name "1.1.1.1%1" while executing "$client_ip equals "2.2.2.2""
Hi guys, I try to do something that looks not difficult, but i'm really stucked. Any help is welcome.
I just want to check the remote client ip and push an ifile proxy.pac to him, and if not i want to push the default one.
I don't understand anything about how to post code there, with the autmatic html formating.Is it so complicated ?
14 Replies
- Steph_69890
Nimbostratus
Are you using "Route Domains? If so, it's probably your error. Example from one of my irule; set userip [getfield [IP::client_addr] "%" 1] switch -glob -- $userip { "10.10.10.*" - "10.10.11.*" - "10.10.13.*" { Do what you want! } default { the default }} - Steph_69890
Nimbostratus
Also, if you need to known the routing domain from an irule; [ROUTE::domain] - Aurel
Cirrus
Hi Steph, i do use one RD. - Aurel
Cirrus
Well, i use the IP::remote_addr which do gather the ip address with the "%1". It seems to be a mistake in this line : - Aurel
Cirrus
when HTTP_REQUEST { - Aurel
Cirrus
set client_ip [IP::remote_addr]} - Aurel
Cirrus
if {[$client_ip equals "1.1.1.1"]} (this line!) - Aurel
Cirrus
{switch -glob [HTTP::uri] (etc...) - Steph_69890
Nimbostratus
Try to dump values [IP::remote_addr] and [IP::client_addr] into your local0.info log. Then try some connection and check your /var/log/ltm. - Aurel
Cirrus
Yes, Steph. I did that. The remote_addr value is my correct ip address with %1 at the end. (1.1.1.1%1). But TCL keep telling me that the command is invalid, while executing "client_ip equal "1.1.1.1""
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
