首页 > 代码库 > [原]ubuntu14.04 网卡逻辑修改没有文件/etc/udev/rules.d/70-persistent-net.rules

[原]ubuntu14.04 网卡逻辑修改没有文件/etc/udev/rules.d/70-persistent-net.rules

 -----问题出现------

在新装的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"
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"

  reboot,完毕

 

 

参考:http://blog.csdn.net/nnuljl/article/details/38680107

[原]ubuntu14.04 网卡逻辑修改没有文件/etc/udev/rules.d/70-persistent-net.rules