Forum Discussion

amit_128525's avatar
amit_128525
Icon for Nimbostratus rankNimbostratus
Dec 04, 2013

Irule for redirect

HeI am trying to understand below irule which is already create don our F5 please advise if possble .

 

when HTTP_REQUEST { if {[HTTP::header exists A-Forwarded-For]}{ HTTP::header replace A-Forwarded-For [substr [IP::client_addr] 0 "%"] } else { HTTP::header insert A-Forwarded-For [substr [IP::client_addr] 0 "%"] } }

 

3 Replies

  • This iRule is looking for a HTTP header called A-Forwarded-For and if it exists it's replacing its value with the client IP address for the connection.

     

    This iRule seems to be reliant on you having route domains configured on your unit as it is looking for "%" as a separator. I presume you are running TMOS v10.x.

     

    If the header is not present then it is inserting it with the client IP address as its value.

     

    Basically it's a way to log the source IP of your HTTP requests through the BIG-IP usually if you use SNAT.

     

  • Hello thanks for reply where I can see a-forward-for details I can't see in http header section Regards amit

     

  • There are a number of ways to do it, the most simple way is to use your web browser's integrated developer tools (Open your browser and hit F12).

     

    On a publicly accessible site you can use http://web-sniffer.net/ to make the request.

     

    You can do a Google search for "view http headers" to get you started.