Forum Discussion

vegetax's avatar
vegetax
Icon for Nimbostratus rankNimbostratus
Mar 14, 2017

X-Forward Remove

Hi, I am trying to write an irule for a vip were we have a http profile assigned and x-forward is enabled but for specific traffic going to that VIP we would like to remove the x-forward and see true client ip and have reach nodes on pool. Can someone give me a an example on how to accomplish this?

 

  • What kind of traffic do you mean by specific traffic? How about this simple example..

     

    if { condition for your specific traffic } {

     

    log local0. "some log message [IP::client_addr]:[TCP::client_port]"

     

    pool your_pool

     

    }

     

    The above log will help you track the client IP from where the specific traffic originated. The next line will direct the traffic to your desired pool. Sorry if my answer doesn't serve your purpose.

     

    • rsacheen's avatar
      rsacheen
      Icon for Nimbostratus rankNimbostratus

      If you are trying to remove Header X-Forward-for, this might help

      when HTTP_REQUEST {

      HTTP::header remove X-Forwarded-For
      

      }

      write some condition for your specific traffic inside the when {}
  • What kind of traffic do you mean by specific traffic? How about this simple example..

     

    if { condition for your specific traffic } {

     

    log local0. "some log message [IP::client_addr]:[TCP::client_port]"

     

    pool your_pool

     

    }

     

    The above log will help you track the client IP from where the specific traffic originated. The next line will direct the traffic to your desired pool. Sorry if my answer doesn't serve your purpose.

     

    • rsacheen_310098's avatar
      rsacheen_310098
      Icon for Nimbostratus rankNimbostratus

      If you are trying to remove Header X-Forward-for, this might help

      when HTTP_REQUEST {

      HTTP::header remove X-Forwarded-For
      

      }

      write some condition for your specific traffic inside the when {}
  • Hi,

     

    Depends what is exact scenario, is that like: 1. Most of the traffic - add XFF header via VS HTTP profile, use SNAT to change source IP before sending to pool members 2. For some traffic - remove XFF added by VS, disable SNAT so real client source IP is preserved when sending to pool members - in this case pool member will have def gateway set to BIG-IP self IP, if not return traffic will not go back via BIG-IP

     

    If not what exactly is your case?

     

    Piotr

     

  • Hi, I was able to resolve this using insert a new parameter in http header instead of removing x-forward. Thank you for your help