Forum Discussion
John_Bartoldus_
Sep 14, 2015Nimbostratus
Strip route domain from ip::remote_addr
Hello.
Trying to create an irule and when using ip::remote_addr, it is adding the %rd to the IP address. I am fairly new to irules, but wondering if that route domain designation can be strip...
- Sep 14, 2015
There are a number of ways of doing that, but here is one (though untested!) that should work:
when HTTP_REQUEST { HTTP::header insert X-Some-Header "[getfield [IP::client_addr] % 1]" }
For more information on
:getfield
I also encourage, for header insertion, that you consider using Local Traffic Policies, if possible:
Vernon_97235
Sep 14, 2015Historic F5 Account
There are a number of ways of doing that, but here is one (though untested!) that should work:
when HTTP_REQUEST {
HTTP::header insert X-Some-Header "[getfield [IP::client_addr] % 1]"
}
For more information on
getfield
:
I also encourage, for header insertion, that you consider using Local Traffic Policies, if possible:
- John_Bartoldus_Sep 15, 2015NimbostratusThis worked nicely. Thanks. Just curious, why Local Traffic Policies instead of iRule? Both in my initial training and F5 professional services recommended iRules instead of Local Traffic Policies. But, that could have been for personal reasons. I am curious to hear pros and cons of each.
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