How can I create device aliases using the Network Administration Tool?
Issue
Device aliases are virtual devices associated with the same physical hardware, but they can be activated at the same time to have different IP addresses. They are commonly represented as the device name followed by a colon and a number (for example, eth0:1). They are useful if you want to have multiple IP address for a system, but the system only has one network card.
Environment
Red Hat Enterprise Linux All versions
Resolution
Note: To use the Network Administration Tool, you must have root privileges.
To start the application, go to the Main Menu Button (on the Panel) => System Settings => Network, or type the command system-config-network at a shell prompt (in RHEL3, the command is redhat-config-network ). If you type the command, the graphical version is displayed if X is running, otherwise, the text-based version is displayed. To force the text-based version to run, use the system-config-network-tui command. To use the command line version, execute the command system-config-network-cmd --help as root to view all the options.
After configuring the Ethernet device, such as eth0, to use a static IP address (DHCP does not work with aliases), go to the Devices tab and click New. Select the Ethernet card to configure with an alias, set the static IP address for the alias, and click Apply to create it. Since a device already exists for the Ethernet card, the one just created is the alias such as eth0:1.
Warning: If you are configuring an Ethernet device to have an alias, neither the device nor the alias can be configured to use DHCP. You must configure the IP addresses manually.
The eth0:1 device is the first alias for eth0. The second alias for eth0 would have the device name eth0:2, and so on. To modify the settings for the device alias such as whether to activate it at boot time and the alias number, select it from the list and click the Edit button.
Select the alias and click the Activate button to activate the alias. If you have configured multiple profiles, select which profiles in which to include it.
To verify that the alias has been activated, use the command /sbin/ifconfig. The output should show the device and the device alias with different IP address:
eth0 Link encap:Ethernet HWaddr 00:A0:CC:60:B7:G4
inet addr:192.168.100.5 Bcast:192.168.100.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:161930 errors:1 dropped:0 overruns:0 frame:0
TX packets:244570 errors:0 dropped:0 overruns:0 carrier:0
collisions:475 txqueuelen:100
RX bytes:55075551 (52.5 Mb) TX bytes:178108895 (169.8 Mb)
Interrupt:10 Base address:0x9000
eth0:1 Link encap:Ethernet HWaddr 00:A0:CC:60:B7:G4
inet addr:192.168.100.42 Bcast:192.168.100.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:10 Base address:0x9000
Note: The alias can be build by modifing scripts under /etc/sysconfig/ifg-<interface> files, please refer to: How do I alias additional TCP/IP addresses to a network card (NIC) in Red Hat Linux?