Modify the default NIC name under Linux/centos 7

Source: Internet
Author: User

When using Linux/centos 7 o'clock it may be found that the default NIC name is a random number after installing the system, the use of the process is extremely inconvenient to use, Linux/centos 7 of this change is due to the introduction of new network card naming technology in SYSTEMD and Udev, The device name can be renamed after the old hardware has been broken, but the initial generated device name is random, and the system will be named Em1 when the early CentOS 6 is out of the system without the biosdevname=0 parameter. With the subsequent compatibility of continuous well after the name of the NIC is still more familiar with the eth0 such, but in the CentOS 7 system only add the biosdevname=0 parameters do not work, but also need to make some changes, the operation is very simple, as follows:

[Email protected] ~]# Cd/etc/sysconfig/network-scripts/[[email protected] network-scripts]# mv Ifcfg-ens33 Ifcfg-eth0 [[email protected] network-scripts]# sed-i ' s/ens33/eth0/g ' ifcfg-eth0# modify NIC name [[email protected] network-scripts]# VIM/ Etc/sysconfig/grubgrub_timeout=5grub_distributor= "$ (SED ' s, release. *$,,g '/etc/system-release)" grub_default= savedgrub_disable_submenu=truegrub_terminal_output= "Console" grub_cmdline_linux= "Crashkernel=auto RHGB Net.ifnames=0 biosdevname=0 quiet "#在这里添加" net.ifnames=0 biosdevname=0 "2 parameters grub_disable_recovery=" true "[email Protected] sysconfig]# Grub2-mkconfig-o/boot/grub2/grub.cfg

If there is no ifconfig tool can be installed with yum-y install Net-tools, after the above modifications to restart the system, the system's default NIC name is changed to the default eth0

This article from "Jim's Technical Essay" blog, reproduced please contact the author!

Modify the default NIC name under Linux/centos 7

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.