Centos修改网卡名称
Centos6修改网卡名称
- 设置步骤
下面的具体步骤:(假设网卡名字是:eth123456)
步骤1: 配置创建并配置 ifcfg-eth0 文件
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# mv ifcfg-eth123456 ifcfg-eth0
[root@localhost network-scripts]# vi ifcfg-eth0 #修改下面两个Key的value
NAME="eth0"
DEVICE="eth0"
步骤2: 修改udev
vi /etc/udev/rules.d/70-custom-net.rules
SUBSYSTEMS=="pci", SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}i=="c8:1f:66:c8:14:bf", NAME="eth0"
注意:多张网卡就设置多个
步骤3:重启
查看效果
Centos7修改网卡名称
下面的具体步骤:(假设网卡名字是:eth123456)
步骤1: 配置创建并配置 ifcfg-eth0 文件
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# mv ifcfg-eth123456 ifcfg-eth0
[root@localhost network-scripts]# vi ifcfg-eth0 #修改下面两个Key的value
NAME="eth0"
DEVICE="eth0"
步骤2: 修改udev
vi /usr/lib/udev/rules.d/60-net.rules
重启服务器之后,再查看网卡,名称已经被修改了