Preserving the Client IP address to iPlanet/SunONE/Sun Java System Web Server servers and ApplicationsWhen ZXTM load-balances a connection to an iPlanet/SunONE/Sun Java System Web Server server or application, the connection appears to originate from the ZXTM machine. This can be a problem if the server wishes to perform access control based on the client's IP address, or if it wants to log the true source address of the request. ZXTM has an IP Transparency feature that preserves the client's IP address, but this requires a kernel module (pre-installed on ZXTM appliances and available separately for ZXTM software) and is currently only available under Linux. As an alternative, Zeus provide several modules for common server applications to work round this issue. This FAQ describes the iPlanet/Sun NSAPI module. ZXTM automatically inserts a special 'X-Cluster-Client-Ip' header into each request, which identifies the true source address of the request. Zeus' iPlanet/Sun NSAPI module inspects this header and corrects the calculation of the source address. This change is transparent to the web server, and to any applications running on or behind the web server. Obtaining the ModuleCompile the module from source: First, build the NSAPI examples in your SunONE installation to determine the appropriate compilation options for your platform:
Then, you can build the iprewrite.so module using similar options. Set NSHOME to the installation location for iPlanet:
Configuring the ModuleTo configure the module, you will need to edit the magnus.conf and obj.conf files for the virtual server you are using. If the virtual server is named 'test', you'll find these files in the https-test/config directory. magnus.confAdd the following lines to the end of the magnus.conf file. Ensure that the shlib option identifies the full path to the iprewrite.so module, and that you set TrustedIPs to either '*', or the list of ZXTM back-end IP addresses:
The TrustedIPs option specifies the back-end addresses of the ZXTM machines. The iprewrite.so module will only trust the 'X-Cluster-Client-Ip' header in connections which originate from these IP addresses. This means that remote users cannot spoof their source addresses by inserting a false header and accessing the iPlanet/Sun servers directly. obj.confLocate the 'default' object in your obj.conf file and add the following line at the start of the directives inside that object:
Restart your iPlanet/Sun servers, and monitor your servers' error logs (https-name/log/errors). If you have misconfigured the TrustedIPs value, you will see messages like:
The ResultiPlanet/Sun, and applications running on the server will see the correct source IP address for each request. The access log module will log the correct address when you use %a or %h in your log format string. Alternate ConfigurationThe 'iprewrite-all' SAF function changes the ip address for the entire duration of the connection. This may be too invasive for some environments, and its possible that a later SAF function may modify the IP address again. You can use the 'iprewrite-func' SAF function to change the ip address for a single NSAPI function. For example, BEA's NSAPI WebLogic connector ('wl_proxy') is normally configured as follows:
You can change the IP address just for that function call, using the iprewrite-func SAF function as follows:
LicensingZeus provide this module without warranty or any guarantees of fitness for purpose. This module is not covered under Zeus' standard terms of support, but Zeus welcomes suggestions for improvement and will make reasonable efforts to support customers who use it. You are free to distribute this module and create derivative works from it, provided that you honour the revised-BSD license associated with the module:
|
Recently...
Other Resources
|





