码迷,mamicode.com
首页 > 其他好文 > 详细

centos 7 网卡名称更改

时间:2016-09-07 23:09:20      阅读:297      评论:0      收藏:0      [点我收藏+]

标签:centos7网卡名称更改

Centos7安装完成后网卡名称默认为enoXXX,非常熟悉的ethX没有了,总是感觉怪怪的。如果最小化安装找不到ifconfig命令,请安装net-tools软件包.更改步骤如下:


  1. [root@server1 ~]#vi /etc/sysconfig/network-scripts/ifcfg-enoXXX

    HWADDR=00:0C:29:AF:BF:18
    TYPE=Ethernet
    BOOTPROTO=dhcp
    DEFROUTE=yes
    PEERDNS=yes
    PEERROUTES=yes
    NAME=enoXXX                   //此处将enoXXX更改为ethX
    UUID=17cdd976-0b81-4286-80cf-185ec95f5ae8
    ONBOOT=no                    //此处将no更改为yes      

  2.  [root@server1 ~]#cd /etc/sysconfig/network-scripts

     [root@server1 ~]#mv ifcfg-enoXXX ifcfg-eth0

  3. [root@server1 ~]# vi /etc/default/grub
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed ‘s, release .*$,,g‘ /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="vconsole.keymap=us crashkernel=auto  vconsole.font=latarcyrheb-sun16 net.ifnames=0 biosdevname=0 rhgb quiet"
    GRUB_DISABLE_RECOVERY="true"   //添加标记为红色的两个参数

  4. [root@server1 ~]# grub2-mkconfig -o /boot/grub2/grub     // 执行此命令,重新加载下grub配置
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
    Warning: Please don‘t use old title `CentOS Linux, with Linux 3.10.0-123.el7.x86_64‘ for GRUB_DEFAULT, use `Advanced options for CentOS Linux>CentOS Linux, with Linux 3.10.0-123.el7.x86_64‘ (for versions before 2.00) or `gnulinux-advanced-66b96693-051c-4021-85ef-5f7ef0f970e2>gnulinux-3.10.0-123.el7.x86_64-advanced-66b96693-051c-4021-85ef-5f7ef0f970e2‘ (for 2.00 or later)
    Found linux image: /boot/vmlinuz-0-rescue-b6f54d97b52944738996d2d9aeb3d59b
    Found initrd image: /boot/initramfs-0-rescue-b6f54d97b52944738996d2d9aeb3d59b.img
    done

  5. [root@server1 ~]# reboot

    重启操作系统,Centos7的网卡名称就更改完成了。


centos 7 网卡名称更改

标签:centos7网卡名称更改

原文地址:http://3160997.blog.51cto.com/3150997/1847466

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!