Forum Discussion
Donster_297784
Apr 09, 2017Nimbostratus
SNAT/X-Forwarded
Hey guys,
Bit of a weird one this. So I have 2 HA pairs both SNAT'ing but require the x forwarded to preserve the original source IP to due an access control for the client IP on the end server....
Kai_Wilke
Apr 09, 2017MVP
Hi Donster,
just the 1st pair has to insert the
X-Forwarded-For
header. This can be done by using a Standard VS with HTTP Profile attached and either X-Forwarded-For
HTTP Profile settings enabled or by disabling the X-Forwarded-For
HTTP Profile settings and deploying an iRule like this...
when HTTP_REQUEST {
HTTP::header remove "X-Forwarded-For"
HTTP::header insert "X-Forwarded-For" [getfield [IP::client_addr] "%" 1]
}
Note: You could also use the iRule of my previous post, if you need to consolidate existing
headers into a unified header. X-Forwarded-For
On the second unit you may also use a Standard VS with HTTP Profile attached - but you don't have to. If a HTTP Profile is getting attached, then you have to make sure that the
X-Forwarded-For
HTTP Profile settings are disabled.
Cheers, Kai
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