Forum Discussion

wpwhite_113613's avatar
wpwhite_113613
Icon for Nimbostratus rankNimbostratus
Apr 09, 2010

Newbie Question on Inserting Source IP Address in a Cookie

I have a couple of 6900s in a HA pair running version 10.1.0. The 6900s are connected in a "one-armed" mode. I have had a sysadmin request the following from me:

 

 

He would like to have the source IP address of the client to be inserted in a cookie so that he can process them on the server side. I'm not sure what he is trying to accomplish; it may just be logging the source IP address since the 6900 is a full proxy.

 

 

Are there any articles out there concerning iRules or a standard LTM config that would take care of this issue?

 

 

Thank you for your help!

 

2 Replies

  • Create a custom http profile (profiles->click the plus sign->http) and enable 'insert x-forwarded-for'. This is a header as opposed to a cookie value, but it's the standard way to do this.

     

     

    -Matt
  • As Matt suggests, it's more common to use the XFF header value. If you did want to use a cookie, you could use something like this:

    
    when HTTP_REQUEST {
        Insert a cookie named CLIENT_IP with the client IP address as a value
       HTTP::cookie insert name CLIENT_IP value [IP::client_addr]
    }
    

    Aaron