Forum Discussion
JustCooLpOOLe
Jun 09, 2017Cirrocumulus
Multiple IPs coming in the client_addr and remote_addr header fields
I'm trying to write an iRule that only places a single IP address in the X-FORWARDED-FOR header. I am using the one below but we are seeing rare cases where the client_addr or remote_addr fields ar...
dragonflymr
Jun 09, 2017Cirrostratus
Hi,
First of all there is no way that [IP::remote_addr] can return multiple IPs - just not possible with TCP.
I guess your conclusion is based on the fact that request arriving to the backend host is still containing multiple XFF headers.
Reason is simple, if original request contains multiple XFF headers then HTTP::header replace is just replacing value/s in last XFF header.
Use combination of:
HTTP::header remove X-Forwarded-For
followed by:
HTTP::header insert X-Forwarded-For [IP::remote_addr]
Piotr
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