Forum Discussion

cymru81's avatar
cymru81
Icon for Altocumulus rankAltocumulus
May 01, 2019

X-Forwarded-For iRule

We are having problem where the ‘X-Forwarded-For’ header is missing when traffic is coming through the Load Balancer.

 

It has been working previously, but looking at what is coming back from the load balancer in the error logs. I can see this ‘X--------------: xxxxxxxxxxx’ which might mean that something is broke on the load balancer and it should be ‘X-Forwarded-For: IP ADDRESS’?

 

Has anyone else experienced similar?

 

We've enabled "Insert X-Forwarded-For" on the http profile.

 

4 Replies

  • I believe you need to pick one, either the iRule or enable insert-xforwarded-for in HTTP profile settings. Try removing the iRule and leaving just the HTTP profile option. It worked for me here in my lab. If you need help with the iRule you need to post the iRule you're using.

     

  • sorry im not clear but we dont have an irule for this currently just http profile setting. what should we try next?

     

  • Well, the X-Forwarded-For setting is supposed to work out of the box. I've tested myself in my lab here and it works. You should post the output of your HTTP profile configuration:

     

    tmsh list ltm profile http

     

    As well as the configuration of the virtual server you attached it to

     

    tmsh list ltm virtual

     

    And lastly take a sample packet capture on tmm (0.0) interface using a sample client of your choice:

     

    tcpdump -i 0.0:nnnp -s0 -w /shared/tmp/xforwarded-test-v1.pcap -v

     

    Community members might try to help you here but if it gets too complicated I'd advise you to open a case with F5 support as they can request a snapshop of your configuration (called qkview) and have a more thorough view of your system.

     

    Regards, Rodrigo

     

  • Removing the irule made no difference, do i need to do anything in IIS?