Get the App
SLTechnology News&Howtos  ›  Servers  › 

CentOS7 changes the name of the network card

Shulou Source: shulou.com Published: 2022-06-02 08:10:26 10月04日 Update

One of the differences between CentOS7 and CentOS6 is that the name of the network card has changed

After installing the network card in CentOS7, it becomes ens37 or ens33 and so on. For convenience of operation, change the name of the network card to eth0. The name of the newly installed CentOS7 network card is ens33.

Edit the configuration file of the network card first, and change the NAME and DEVICE entries to eth0.

Rename the configuration file of the network card

Modify kernel parameters to disable the naming rules of the network card

By editing / etc/default/grub and adding "net.ifnames=0" to the GRUB_CMDLINE_LINUX variable

Run grub2-mkconfig-o / boot/grub2/grub.cfg to regenerate the GRUB configuration and update kernel parameters

Reboot command to restart the machine

When the system reboot is complete, it is found that the name of the network card becomes eth0.

Tags: Nic name configuration kernel parameters files variables commands that is machines systems rules Xin an Riga update generate run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Redmi Shulou Technology MySQL MariaDB