Forum Discussion
Geoff_Littlewoo
Nimbostratus
Jul 24, 2009Use iRulke to extract X-Forwarded out of HTTP packet
I have a polling HTTP pakcet that the LTM does not see as a proper compliant HTTP packet.
Due to this the device sends a single packet in and the F5 closes the connection. This connection needs to remain open. To fix this, the HTTP profile is removed from the Virtual Server. The X-Forwarded header is needed fromn the packets that then flow through the LTM. The X-Forwarded header becomes the IP address of the LTM and not the source device.
I am looking for an iRule that will look at this packet and extract the X-Forwarded contents and send it through, as the souce address sent becomes the interface of the LTM.
- Geoff_Littlewoo
Nimbostratus
I amunable to write an iRule pickign out the following because I cannot use a HTTP profile. - hoolio
Cirrostratus
Can you clarify this? Do you want LTM to spoof the value of the XFF header that a prior device in the chain inserted? Or do you want LTM to insert the IP address it received as the client into an XFF header? - Geoff_Littlewoo
Nimbostratus
Aaron - Geoff_Littlewoo
Nimbostratus
Aaron, - hoolio
Cirrostratus
If you need to see the original client IP address in logs and cannot add an HTTP profile, it would be a lot more efficient in terms of LTM processing to change the default gateway to the LTM and turn off SNAT on the VIP. You wouldn't need to insert the XFF header then or add an HTTP profile. - Geoff_Littlewoo
Nimbostratus
Aaron, - hoolio
Cirrostratus
It would be more efficient to use an HTTP profile if you can. The alternative is to collect every TCP payload and insert the HTTP header in the TCP payload.when HTTP_REQUEST { Insert XFF header HTTP::header insert X-Forwarded-For [IP::client_addr] Disable the HTTP profile for the rest of this TCP connection HTTP::disable }
- Geoff_Littlewoo
Nimbostratus
Aaron, - Geoff_Littlewoo
Nimbostratus
Is there any way of stopping this, as need to consistantly have the source IP and no the LTM and the device will be heartbeating frequently. - hoolio
Cirrostratus
What VIP configuration are you using? Is SNAT enabled or disabled? Are you using an iRule?
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