Skip to content Skip to main navigation Skip to footer

CentOS 7 /RHEL7 如何修改网卡名字为eth*

在centos7 系统里,网卡的名字已经不是 以前的eth0 或者eth*这样的,而是变成了enp0s3这样的,那么如何将网卡的名字从enp0s3改成eth0这样的呢?
centos 7
1# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

    name="eth0"
 

2# mv /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-eth0
3# vi /etc/default/grun

  GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto  vconsole.keymap=us rhgb quiet"
    GRUB_DISABLE_RECOVERY="true
 

在rhgb quiet中添加:net.ifnames=0 biosdevname=0
4# 重新建立grub文件

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

5# 重新启动服务器

0 Comments

There are no comments yet

Leave a comment

Your email address will not be published.