Forum Discussion
Huw_Jenkins_425
Nimbostratus
Dec 01, 2006Preserve Client IP in HTTP Header when using SNAT
Hi
i am trying to configure an iRule to preserve the client ip address when connecting to a VS. i have configured the following iRule, and added to the VS, but when i view the IIS logs on t...
Chad_Roberts_21
Nimbostratus
Dec 01, 2006I think the only thing wrong with your iRule is that you're using [IP::remote_addr] instead of [IP::client_addr]. Be definition, you're using the end IP, not the start.
However, if you're trying to add this header to ALL traffic on that virtual server without putting in any additional logic, you'd be better off simply adding the header in the HTTP profile. There is a "Header Insert" option there where you could place it instead. Instead of the syntax you used above, I believe it would be
ORIG_CLIENT_IP:[IP::client_addr]
(Edit - I mistyped the one above the first time. Oops...)
Also, note the option in there called "Insert XForwarded For." This does the exact same thing you're trying to do, except the name of the header is "X-Forwarded-For" instead of "ORIG_CLIENT_IP".
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