1. First, check the network configuration command in the system: ifconfig2. in linux, the NIC is called eth0, eth1, eth2 ..... all Nic configuration files are stored in/etc/sysconfig/network-script. The file name is ifcfg-eth0, ifcfg-eth1, if...
1. First, let's check the network configuration in the system.
Command: ifconfig
2. in linux, the NIC is called eth0, eth1, eth2...... all the Nic configuration files are stored in/etc/sysconfig/network-script. The file name is named after 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) go to the NIC configuration file directory:
Cd/etc/sysconfig/network-scripts/
View your Nic configurations:
(2) run the following command to configure a virtual Nic device:
Vi ifcfg-eth0: 0 Write the commands shown below in your configuration file case sensitive
Before editing, enter edit mode and press I.
After editing, save the command: (: wq) and exit and save
(3) restart the network configuration to take effect:
Service network restart
In this case, OK. Check the two ip addresses.
,
This article is from the "learning network path" blog