阿里云代理凯铧互联分享centos7如何将网卡名字改成eth样式
发布时间:2017-12-26 19:30:11
1、打开/etc/sysconfig/grub,
# vim /etc/sysconfig/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 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
2、修改上面内容中的GRUB_CMDLINE_LINUX的值,增加net.ifnames=0 biosdevname=0
# vim /etc/sysconfig/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-sun16net.ifnames=0 biosdevname=0 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
3、执行:grub2-mkconfig -o /boot/grub2/grub.cfg
然后,重启系统,网卡名字就变成eht0了