Forum Discussion
lardyboy_lardyb
Nimbostratus
Dec 15, 2004inserting client ip address into header when using SNAT
iRules novice here !!
I have a need to add the real client IP into the HTTP header when using a SNAT rule, but I need to do it dynamically. this is due to the upstream proxy using clie...
unRuleY_95363
Dec 15, 2004Historic F5 Account
This is actually something a lot of people do...
So here is an example that preserves the original client IP in a HTTP header called "ORIG_CLIENT_IP" (you could replace the name with any other name you want and/or also put it in a cookie to the server:
rule preserve_client_ip {
when HTTP_REQUEST {
HTTP::header insert ORIG_CLIENT_IP [IP::remote_addr]
}
}
And there you have it. If you wanted to add it as a cookie then use the instead:
HTTP::cookie insert ORIG_CLIENT_IP [IP::remote_addr]
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