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

在CENTOS7/RHEL7修改网卡名称

时间:2016-03-24 18:37:26      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:centos7 rhel7 修改网卡

1、禁用可预测命名规则

# vim /etc/default/grub

添加两句: net.ifnames=0 biosdevname=0


GRUB_TIMEOUT=5

GRUB_DEFAULT=saved

GRUB_DISABLE_SUBMENU=true

GRUB_TERMINAL_OUTPUT="console"

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

GRUB_DISABLE_RECOVERY="true"


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

Generating grub configuration file ...

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

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

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

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

done


2、修改网卡配置文件

# cd /etc/sysconfig/network-scripts/

# mv ifcfg-enoxxxxxx ifcfg-eth0


3、修改设备对应名称

# vim /etc/udev/rules.d/70-persistent-ipoib.rules

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:e0:17:54", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


4、重启系统即可



本文出自 “Huboss的自动化运维之路” 博客,请务必保留此出处http://huboss.blog.51cto.com/9883568/1754890

在CENTOS7/RHEL7修改网卡名称

标签:centos7 rhel7 修改网卡

原文地址:http://huboss.blog.51cto.com/9883568/1754890

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