Consider this scenario – You expose your web services to IPv6 clients using an IPv6 VIP (Virtual IP) on NetScaler. In the backend your servers are a mix of IPv4 and IPv6 hosts serving the same content to the end users. NetScaler allows you to bind mix of IPv6 and IPv4 servers to the same virtual server. When the request arrives at NetScaler, it decides to use one of the IPv4 or IPv6 servers bound to it based on the chosen Load Balancing algorithm.
For the purpose of this blog, following configuration was used:
- VIP (IPv6) – 2002::11
- IPv4 Server – 10.102.216.6
- IPv6 Server – 2002::6
- IPv4 SNIP – 10.102.216.15
- IPv6 SNIP – 2002::15
For such a scenario to work properly it must be ensured that IP information carried in any HTTP header is aligned with the type of server the request is going to. If the request is going to IPv4 servers, HTTP headers must carry the IPv4 addresses and ditto for IPv6 servers. If an IPv4 server gets an IPv6 address in a header where it expects IPv4 address, server will reject the request.
NetScaler provides mechanism to modify existing “Host” header in the HTTP packets or insert new headers with IP information. There are two methods:
1. set ns ip6 <IPv6Address> -map <IPAddress>
Using this command you can create a mapping between IPv6 address and IPv4 address. Whenever NetScaler load balances a request to IPv6 server, IPv6 information in the host header is retained. But whenever NetScaler load balances the request to IPv4 server, mapped IP is inserted in Host header. This ensures that IPv4 server processes the request without errors.
Example: Set ns ip6 2002::11 –map 10.10.10.11
When the request is load balanced to IPv6 server:
When the request is load balanced to IPv4 server:
2. set lb vserver [-insertVserverIPPort <insertVserverIPPort> [<vipHeader>] ]
insertVserverIPPort can take three values – OFF, VIPADDR and V6TOV4MAPPING. Default is OFF.
When VIPADDR is used, NetScaler inserts the IPv6 VIP with the new “vipHeader”
When V6TOV4MAPPING, NetScaler inserts IPv6 VIP for requests to IPv6 servers and mapped IPv4 IP for requests to IPv4 servers with the new “vipHeader.
Example: Set lb vserver vs6 –insertVserverIPPort V6TOV4MAPPING “vip-header64”
This command will add the “vip-header64” to the HTTP packets.
When request is load balanced to IPv4 server:
When request is load balanced to IPv6 server: