Citrix

How to Insert a Client IP Address in an HTTP Header without Using the Client IP Insertion Feature of a NetScaler Appliance

  • CTX128802
  • Created onMar 26, 2014
  • Updated onApr 15, 2014
Article Topic Load Balancing/High Availability

Objective

This article describes how to insert a Client IP address in an HTTP header without using the Client IP Insertion feature of a NetScaler appliance.

Instructions

To insert a Client IP address in an HTTP header without using the Client IP Insertion feature of a NetScaler appliance, complete the following procedure from the command line interface of the appliance:

  1. Run the following command to create a rewrite action for adding the Client IP address to the x-ip HTTP header:

    add rewrite action insert_xip_act insert_http_header x-ip CLIENT.IP.SRC
  2. Run the following command to create a rewrite policy:

    add rewrite policy insert_xip_pol "!HTTP.REQ.HEADER(\"x-ip\").EXISTS" insert_xip_act

    Note: You can also use named expressions with AppExpert for configuring the policies. You can use the name of the expression instead of referring to the entire expression in a policy. To create a name for a policy expression, you can run the following command:

    add policy expression adv_expr_xip_not_exist "!HTTP.REQ.HEADER(\"x-ip\").EXISTS"

    You can then use the adv_expr_xip_not_exist expression name when creating the rewrite policy instead of the actual expression.

  3. Run the following command to bind the rewrite policy at the global level of the appliance:

    bind rewrite global insert_xip_pol 90 END -type REQ_OVERRIDE

    The following are sample screen shots indicating the insertion of the x-ip HTTP header in Firefox Tamper Data:

    User-added image

    User-added image

    Notice that the original x-ip HTTP header from the backend server is not modified.

    Note: These screens hots are taken for the HTTP requests before a NetScaler appliance is implemented between the client and the backend server.

    The following is a sample screen shot of the network packet trace on a NetScaler appliance after implementing an appliance between the client and the backend server:

    User-added image

    Notice that the x-ip HTTP header is added to the GET HTTP request.

Applicable Products

Automatic translation

Important: This article was translated by an automatic translation system (also referred to as Machine Translation, or MT) and has not been translated or reviewed by people. Citrix offers a machine translated version of this article to allow for greater access to the support content. However, automatic translation is not always perfect and may contain errors of vocabulary, syntax or grammar. Citrix is not responsible for inconsistencies, errors or damage incurred as a result of the use of MT articles from our customers.Thank you.
Click here to see the English version of this article.
Languages
Was this helpful?
Thank you for your feedback

Share your comments or find out more about this topic

Citrix Forums