Linux6-修改网卡名字:eth2—>>>>eth1
Linux6-修改网卡名字:eth2--->>>>eth1
1、由于未发现有/etc/udev/rule.d/70-persistent-net.rules文件,重启;重启后也未发现此文件
2、手动执行/lib/udev/write_net_rules;提示缺少变量INTERFACE
root@server:/lib/udev/rules.d# /lib/udev/write_net_rules
missing $INTERFACE
增加变量:
root@server: export INTERFACE="eth0"
missing valid match
root@server:export MATCHADDR="00:0c:29:1f:1a:f5"
root@server:/lib/udev/write_net_rules
# ls /etc/udev/rules.d/
70-persistent-net.rules README
修改70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:1f:1a:f5", KERNEL=="eth*", NAME="eth0"
修改后:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:1f:1a:eb", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:1f:1a:f5", KERNEL=="eth*", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:1f:1a:ff", KERNEL=="eth*", NAME="eth2"