红联Linux门户
Linux帮助

网卡逻辑修改没有/etc/udev/rules.d/70-persistent-net.rules

发布时间:2016-10-31 09:21:50来源:linux网站作者:my_cool2007
问题出现
在新装的ubuntu14.04系统中没有发现文件/etc/udev/rule.d/70-persistent-net.rules, 无法修改网络的逻辑名称(即把第一张网卡的名字改为改为eth0,第二张网卡的名字改为eth0)
 
思路
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"<br>missing valid match
root@server:export MATCHADDR="00:0c:29:1f:1a:f5"
root@server:/lib/udev/write_net_rules<br><br>
# 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"
reboot,完毕。
 
参考:http://www.linuxdiyf.com/linux/19585.html
 
本文永久更新地址:http://www.linuxdiyf.com/linux/25563.html