CentOS7 modify the network card name

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.

Modify the network card configuration file name##

cd /etc/sysconfig/network-scripts
sudo mv ifcfg-enp3s0 ifcfg-eth0

Modify network card configuration##

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

Modify /etc/default/grub configuration##

Edit the /etc/default/grub file

will

GRUB_CMDLINE_LINUX="rhgb quiet"

To

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 rhgb quiet"

Regenerate the grub configuration file##

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Finally, restart the machine.

Recommended Posts

CentOS7 modify the network card name
Centos7 change the network card name
CentOS8 network card configuration file
Set the network card to bridge mode under CentOS6.3 KVM
centos7 cannot connect to the external network
How to modify the hostname on CentOS 8
CentOS7.0 network configuration
CentOS 7.0 network configuration
Modify CentOS hostname
VMware Fusion install CentOS7 and configure the network
Centos7.6 dual network card configuration and switching test
How to modify the CentOS server time to Beijing time
Modify the default encoding of mysql5.6 under CentOS7
Centos7 modify the system language to simplified Chinese
Ubuntu 18.04 network card configuration
Tencent cloud centos 8.0 single network card configuration multiple IP
CentOS 7 network settings --- connectivity
How to support TL-WDN7200H wireless USB network card in CentOS8?
How to set or modify the time zone in CentOS 8
Centos6.5 desktop version network settings
Implementation of CentOS8.0 Network Configuration
Centos system modify time zone
Centos network settings in virtualbox
The difference between CentOS 7 and CentOS 6