On CentOS7, use ifconfig to check that the default network card name is enp3s0. If you want to modify the network card name, such as changing the network card name to eth0, you need to go through the following steps.
cd /etc/sysconfig/network-scripts
sudo mv ifcfg-enp3s0 ifcfg-eth0
Edit the ifcfg-eth0 file, the content is as follows:
DEVICE=eth0
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
NM_CONTROLLED=yes
PEERROUTES=yes
DNS1=8.8.8.8
Edit the /etc/default/grub file
will
GRUB_CMDLINE_LINUX="rhgb quiet"
To
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 rhgb quiet"
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Finally, restart the machine.
Recommended Posts