11.2.4.8. Notifying client IP address to a registered Web Server¶
Operation Confirmed Version: | |
---|---|
Citrix Netscaler VPX Version11.0 Build67.12 Standard Edition |
A Load Balancer has X-Forwarded-For function to notify client IP address to a registered Web Server.
X-Forwarded-For function will be introduced here.
What is X-Forwarded-For
X-Forwarded-For is a function to enable insertion of client IP address to a field in the HTTP header.
By this function, it becomes possible to know the actual client IP address even when a Load Balancer and the like are inserted in the midway and the source IP address has been translated in the access to a Web Server.
Enabling X-Forwarded-For¶
Presumed case for sample setting
Assume that we want to be able to check on the Server, the actual IP address of the client PC that accesses the Web Server.
Configuration diagram
The check will be made in the following registration/setting conditions.
Setting Items |
Setting value |
Virtual PC |
192.168.1.103 |
Load Balancer |
192.168.2.11 |
Virtual Server | IP Address:192.168.1.200 |
Distribution destination Web Server |
IP Address:192.168.2.12 |
Additional Setting |
X-Forwarded-For enabled |
Note
To check this function you need to have an environment to access the Web Server via a Load Balancer.
From the [ Configuration ] menu, move to [ Traffic Management ] → [ Services ]. Select the configured Service (www1) and click [ Edit ].
As [ Insert Client IP Address ] is set to NO, click the right button on the [ Settings ] item to open the Edit screen of contents of the setting.
If you check mark [ Insert Client IP Address ] on the [ Settings ], you will access the Server with the client IP address written to the HTTP header by the Load Balancer”.
That completes the setting of X-Forwarded-For.
Operation check result
From a browser of a client PC, access the IP Address (192.168.1.200) of the Virtual Server.
The Load Balancer adequately performed distribution to Servers.
You can see that a web page is displayed on the browser of the client PC.
Packet Capture was performed of the HTTP access from the client above.
Then, we checked the header information to the Virtual Web Server and found
that the client IP address is stored by X-Forwarded-For function.