Article Title: how to configure multiple IP addresses for a network card in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
We know that in Linux, NICs are called eth0, eth1, eth2 ......, All Nic configuration files are stored in/etc/sysconfig/network-script/, the file name is ifcfg-eth0, ifcfg-eth1, ifcfg-eth2 ...... . A Nic corresponds to a configuration file. What should we do if we want to configure two IP addresses for eth0?
1. Execute "cp ifcfg-eth0 ifcfg-eth0: 1" to copy the configuration file of eth0, the file name is added after the original file name ": 1 ".
2. Edit the field in modify ifcfg-eth0: 1 as follows:
# VIA Technologies, Inc. VT6102 [Rhine-II] DEVICE = eth0 // The DEVICE must be changed to eht0: 1. BOOTPROTO = none BROADCAST = 192.168.1.255 // BROADCAST address of the IP address, corresponding HWADDR = 00: 14: 2A: 2D: 59: 6B // the Mac address of the NIC, which does not need to be modified. IPADDR = 192.168.1.17 // change the IP address to the one you want IPV6INIT = yes IPV6_AUTOCONF = yes NETMASK = 255.255.255.0 // subnet mask, corresponding NETWORK = 192.168.1.0 // NETWORK address, corresponding ONBOOT = yes GATEWAY = 192.168.1.1 // The GATEWAY address. TYPE = Ethernet PEERDNS = yes USERCTL = no |