How to add a new Nic to centos
1. Add a new network adapter in the virtual machine according to the following two images
2. Check whether the NIC is identified!
Vi/etc/udev/rules. d/70-persistent-net.rules # You can see two NICs!
Copy the MC address of the eth1 Nic. Next we will create the ifcfg-eht1 file !! (At the beginning, I was depressed for a long time because I couldn't find this file !! Why don't you think about creating it yourself !!....)
3. Create a ifcfg-eht1 Nic Profile
Cd/etc/sysconfig/network-scripts/cp ifcfg-eht0 ifcfg-eht1 and then modify the name of the NIC/MC address/IP address and so on ..!! (Because we copy the eth0 Nic configuration, pay attention to the MAC address of the query above, to modify in the ifcfg-eth1, or it will report an error, the second Nic, cannot start
Save and exit
Use ifconfig to check whether the new IP address has been added
/Etc/init. d/network reload
If you want to restart the network to make the IP address take effect, enter:
Service network restart
In this way, the instance is successfully added !!!