一、禁用可預測命名規則linux
# vim /etc/default/grubios
添加兩句: net.ifnames=0 biosdevname=0vim
GRUB_TIMEOUT=5centos
GRUB_DEFAULT=savedide
GRUB_DISABLE_SUBMENU=trueui
GRUB_TERMINAL_OUTPUT="console"spa
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevname=0 rhgb quiet"ip
GRUB_DISABLE_RECOVERY="true"it
# grub2-mkconfig -o /boot/grub2/grub.cfgio
Generating grub configuration file ...
Found linux p_w_picpath: /boot/vmlinuz-3.10.0-229.el7.x86_64
Found initrd p_w_picpath: /boot/initramfs-3.10.0-229.el7.x86_64.img
Found linux p_w_picpath: /boot/vmlinuz-0-rescue-a8ecfd39a4014521ae54ccef4ada1c67
Found initrd p_w_picpath: /boot/initramfs-0-rescue-a8ecfd39a4014521ae54ccef4ada1c67.img
done
二、修改網卡配置文件
# cd /etc/sysconfig/network-scripts/
# mv ifcfg-enoxxxxxx ifcfg-eth0
三、修改設備對應名稱
# 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"
四、重啓系統便可