Aliasing the network interface card or loopback device
About this task
The cluster address should not be aliased to the loopback interface if the server is defined for NAT (Network Address Translation) forwarding.
To alias the loopback device on servers that are being load-balanced, you must use the operating system's adapter configure commands. For the load-balanced server machines to work, you must set, or preferably alias, the loopback device, which is often called lo0, to the cluster address. By setting or aliasing the loopback device to the cluster address, the load balanced server machines will accept a packet that was addressed to the cluster address.
![[Linux]](../images/linux.gif)
Procedure
Use the following commands to alias the network interface and the loopback device (interface_name) for AIX systems :
- For IPv4 addresses:
ifconfig lo0 alias cluster_address netmask 255.255.255.255
- For IPv6 addresses:
ifconfig interface_name inet6 cluster_address/prefix_length alias
For example, to alias the loopback device on servers that are being load-balanced:ifconfig lo0 inet6 2002:4a::541:56/128 alias
- For IPv4 addresses:
Use these commands to alias the network interface and the loopback device (interface_name) for HP-UX systems:
- For IPv4 addresses:
ifconfig lo0:1 cluster_address up
- For IPv6 addresses:
ifconfig interface_name:alias inet6 cluster_address up prefix prefix_length
For example, to alias the loopback device on servers that are being load-balanced:ifconfig lo0:1 inet6 3ffe:34::24:45 up prefix 128
Avoid trouble: When using bind-specific server applications that bind to a list of IP addresses that do not contain the server's IP, use the arp publish command instead of ifconfig to dynamically set an IP address on the Load Balancer machine. For example:
gotchaarp -s <cluster> <Load Balancer's MAC address> pub
- For IPv4 addresses:
Use these commands to alias the network interface and the loopback device (interface_name) for Linux systems:
- For IPv6 or IPv4 addresses:
ip -version addr add cluster_address/prefix_length dev lo
For example, to alias the loopback device on servers that are being load-balanced:ip -6 addr add 3ffe:34::24:45/128 dev lo ip -4 addr add 12.42.38.125/32 dev lo
Note: You can also use the ifconfig command. See below to alias the loopback device using the ifconfig command. Once you issue one of the configuration commands on your machine, it is important to consistently use the same configuration command (ip or ifconfig), or unexpected results can occur. - Using the ifconfig command:
ifconfig lo:1 cluster_address netmask 255.255.255.255 up
- For IPv6 or IPv4 addresses:
Use the following commands to alias the network interface and the loopback device (interface_name) for Solaris systems.
- For IPv4
addresses:
ifconfig lo0:1 plumb cluster_address netmask netmask up
- For IPv6 addresses:
ifconfig interface_name inet6 addif cluster_address/prefix_length up
For example, to alias the loopback device on servers that are being load-balanced:ifconfig lo0 inet6 addif 3ffe:34::24:45/128 up
Avoid trouble: When using bind-specific server applications that bind to a list of IP addresses that do not contain the server's IP, use the arp publish command instead of ifconfig to dynamically set an IP address on the Load Balancer machine. For example:
gotchaarp -s <cluster> <Load Balancer's MAC address> pub
- For IPv4
addresses:
Use these commands to alias the network interface and the loopback device for Windows operating systems.
- Use the ipconfig /all command to determine the interface name for the
loopback device.
This command locates the connection with a description of the Microsoft Loopback Adapter. The following example is the output from the ipconfig /all command, where the Microsoft Loopback Adapter is Ethernet adapter Local Area Connection 2, so the connection is Local Area Connection 2:
Windows IP Configuration Host Name . . . . . . . . . . . . : ndserv10 Primary Dns Suffix . . . . . . . : rtp.raleigh.ibm.com Node Type . . . . . . . . . . . . : Unknown IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : rtp.raleigh.ibm.com Ethernet adapter Local Area Connection 2: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Loopback Adapter Physical Address. . . . . . . . . : 02-00-4C-4F-4F-50 DHCP Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 9.42.92.158 Subnet Mask . . . . . . . . . . . : 255.255.252.0 IP Address. . . . . . . . . . . . : 9.42.92.159 Subnet Mask . . . . . . . . . . . : 255.255.252.0 IP Address. . . . . . . . . . . . : 2002:92a:8f7a:162:9:42:92:160 IP Address. . . . . . . . . . . . : 2002:92a:8f7a:162:9:42:92:159 IP Address. . . . . . . . . . . . : fe80::4cff:fe4f:4f50%4 Default Gateway . . . . . . . . . : DNS Servers . . . . . . . . . . . : 127.0.0.1 fec0:0:0:ffff::1%1 fec0:0:0:ffff::2%1 fec0:0:0:ffff::3%1
Note: If the loopback interface is not shown in the ipconfig output, it might need to be installed. For basic loopback installation instructions, see the Microsoft documentation on how to Install a Microsoft loop adapter. Consult Microsoft documentation for detailed instructions for specific operation system levels. - Add the cluster address to the loopback using the netsh command.
For example:
netsh interface ipv6 add address "Local Area Connection 2" 2002:92a:8f7a:162:9:42:92:161
- Issue the following ipconfig /all command again, and you should see the
address added on the loopback adapter.
For example, issue the following command:
You should see output that is similar to the following:ipconfig /all
Ethernet adapter Local Area Connection 2: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Loopback Adapter Physical Address. . . . . . . . . : 02-00-4C-4F-4F-50 DHCP Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 9.42.92.158 Subnet Mask . . . . . . . . . . . : 255.255.252.0 IP Address. . . . . . . . . . . . : 9.42.92.159 Subnet Mask . . . . . . . . . . . : 255.255.252.0 IP Address. . . . . . . . . . . . : 2002:92a:8f7a:162:9:42:92:161 IP Address. . . . . . . . . . . . : 2002:92a:8f7a:162:9:42:92:160 IP Address. . . . . . . . . . . . : 2002:92a:8f7a:162:9:42:92:159 IP Address. . . . . . . . . . . . : fe80::4cff:fe4f:4f50%4 Default Gateway . . . . . . . . . : DNS Servers . . . . . . . . . . . : 127.0.0.1 fec0:0:0:ffff::1%1 fec0:0:0:ffff::2%1 fec0:0:0:ffff::3%1
- Enable forwarding for all the ethernet interfaces in the machine using the netsh
interface ipv6 show interface command.
Any interfaces listed with a name of Local Area Connection must have IP forwarding enabled. For example:
netsh interface ipv6>show interface Querying active state... Idx Met MTU State Name --- ---- ----- ------------ ----- 6 2 1280 Disconnected Teredo Tunneling Pseudo-Interface 5 0 1500 Connected Local Area Connection 4 0 1500 Connected Local Area Connection 2 3 1 1280 Connected 6to4 Pseudo-Interface 2 1 1280 Connected Automatic Tunneling Pseudo-Interface 1 0 1500 Connected Loopback Pseudo-Interface netsh interface ipv6>set interface "Local Area Connection" forwarding=enabled Ok. netsh interface ipv6>set interface "Local Area Connection 2" forwarding=enabled Ok.
Windows Server 2008 and higher must have weak send enabled for the loopback and ethernet interfaces.
netsh interface ipv6 set interface "Local Area Connection 2" weakhostreceive=enabled netsh interface ipv6 set interface "Local Area Connection 2" weakhostsend=enabled netsh interface ipv6 set interface "Local Area Connection" weakhostreceive=enabled netsh interface ipv6 set interface "Local Area Connection" weakhostsend=enabled
- Verify that the settings for each Local Area Connection. Use the following
commands:
netsh interface ipv6>show interface "Local Area Connection" netsh interface ipv6>show interface "Local Area Connection 2"
- Use the ipconfig /all command to determine the interface name for the
loopback device.


File name: tcfg_aliasloopback.html