Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to modify the name of the network card in centos7

Shulou Source: shulou.com Published: 2022-06-01 18:34:12 11月15日 Update

In this issue, Xiaobian will bring you about how to modify the name of the network card in centos7. The article is rich in content and analyzes and narrates it from a professional perspective. After reading this article, I hope you can gain something.

1. Copy NIC interface configuration file

Ruby Code Copy content to clipboard

# cd /etc/sysconfig/network-scripts/

# cp ifcfg-ens32 ifcfg-eth0

Edit ifcfg-eth0 to change ens32 in the file to eth0

Ruby Code Copy content to clipboard

# cd /etc/sysconfig/network-scripts/

# cp ifcfg-ens32 ifcfg-eth0

Edit ifcfg-eth0 to change ens32 in the file to eth0

2. modify the grub

Ruby Code Copy content to clipboard

# vim /etc/default/grub

Modify the GRUB_CMDLINE_LINUX line by adding net.ifnames=0 biosdevname=0 as follows:

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

# vim /etc/default/grub

Modify the GRUB_CMDLINE_LINUX line by adding net.ifnames=0 biosdevname=0 as follows:

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

3. Regenerate the grub.cfg file

Python

Ruby Code Copy content to clipboard

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

Generating grub configuration file ...

Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64

Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img

Found linux image: /boot/vmlinuz-0-rescue-cbe15acd3ca347f4a373c8f4adaf2619

Found initrd image: /boot/initramfs-0-rescue-cbe15acd3ca347f4a373c8f4adaf2619.img

done

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

Generating grub configuration file ...

Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64

Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img

Found linux image: /boot/vmlinuz-0-rescue-cbe15acd3ca347f4a373c8f4adaf2619

Found initrd image: /boot/initramfs-0-rescue-cbe15acd3ca347f4a373c8f4adaf2619.img

done

The above is how to modify the name of the network card in centos7 shared by everyone. If you happen to have similar doubts, you may wish to refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.

Tags: Content clipboard documents cut-and-paste network card name analysis professional small and medium rich in content that is copy interface article more knowledge article industry perspective information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Docker MariaDB Shulou Tech Info Apple