Get the App
SLTechnology News&Howtos  ›  Servers  › 

Centos 7 modify the name of the network card

Shulou Source: shulou.com Published: 2022-06-02 13:37:00 10月04日 Update

The default network card name of Centos 7 is ens33. If you are accustomed to the Centos eth name, or if you want to change it to be more personalized, please follow these steps. The pro-test is valid.

1. Modify the name in the Nic file

(1) the name NAME= wants (eth0, etc.)

DEVICE= as above

(2) modify the name of the Nic file

Cd / etc/sysconfig/network-scripts/

Mv ifcfg-ens33 ifcfg-eth0

(3) modify and load the Nic name grub file

Use the file vim grub in the cd / etc/default/grub directory

Under the GRUB_CMDLINE_LINUX line file, write before rhgb quiet

The complete method of net.ifnames=0 biosname=0 is as follows:

GRUB_CMDLINE_LINUX= "crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevname=0 rhgb quiet

(4) load grub file configuration information

Grub2-mkconfig-o / boot/grub2/grub.cfg Don't forget the parameter-o.

If my dear friends don't even bother to do Man, then I will continue to provide.

SYNOPSIS

Grub-mkconfig [- o |-- output=FILE] Don't ask me why, please make up for it yourself.

(5) the important thing is to restart the operating system painting to take effect, so use it cautiously in the production environment, lest the leader can't stop the 40m knife.

Tags: File name network card dear valid important operating system personality thing information parameter as above that is color file name method friend step environment directory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Information OPPO Reno Xiaomi Huawei