Forum Discussion
Is it possible to replace source ip as x forwarded ip?
Can we change the client/source ip before sending the request to the server with the x forwarded ip. The application team needs to use the source ip in their code.
- Rico_368208
Nimbostratus
Draco,
Here is an iRule that should take the contents of the X-Forwarded-For header and SNAT to that IP. I would be careful with this though as unless the F5 is set you be your default gateway, the server may try to send the data back to the client directly. This asymmetrical routing will cause issues with connection.
when HTTP_REQUEST { snat [HTTP::header value X-Forwarded-For] }
If you have any issues with this iRule or any further questions, I am sure I can help.
- Rico
Cirrus
Draco,
Here is an iRule that should take the contents of the X-Forwarded-For header and SNAT to that IP. I would be careful with this though as unless the F5 is set you be your default gateway, the server may try to send the data back to the client directly. This asymmetrical routing will cause issues with connection.
when HTTP_REQUEST { snat [HTTP::header value X-Forwarded-For] }
If you have any issues with this iRule or any further questions, I am sure I can help.
Recent Discussions
Related Content
* 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