CentOS修改网卡名称
修改网络配置文件设备名称
[root@web02 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ethX
重命名网卡配置文件的名称信息
[root@web02 ~]# cd /etc/sysconfig/network-scripts/ [root@web02 network-scripts]# mv ifcfg-eth33 ifcfg-eth0
修改网卡名称规则内核文件
[root@web02 /]# vim /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_DISABLE_RECOVERY="true" GRUB_CMDLINE_LINUX="crashkernel=auto net.ifnames=0 biosdevname=0 rhgb quiet"
使系统重新加载grub配置文件
[root@web02 /]# grub2-mkconfig -o /boot/grub2/grub.cfg
方法二:
/etc/udev/rules.d/70-persistent-net.rules
[root@localhost ~]# vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:5a:8c:72", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
然后进入网卡目录下进行修改名称,重启就完成了
继续阅读

我的微信
这是我的微信扫一扫
评论