请给我一个线索,它在哪里?
它不在/etc/udev/rules.d下
# find / -name "*persistent-net.rules"找不到任何东西…
Centos 7和Redhat 7默认使用biosdevname
rpm -qi biosdevname-0.5.0-10.el7.x86_64 Summary : Udev helper for naming devices per BIOS names Description : biosdevname in its simplest form takes a kernel device name as an argument, and returns the BIOS-given name it "should" be. This is necessary on systems where the BIOS name for a given device (eg the label on the chassis is "Gb1") doesn't map directly and obviously to the kernel name (eg eth0).
如果它不在那里,你可以简单地创build它!
规则将适用。 这是我的例子:
[root@WesternStar rules.d]# pwd /etc/udev/rules.d [root@WesternStar rules.d]# cat 70-persistent-net.rules |grep -v \# SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:4e:40:9a", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" [root@WesternStar rules.d]#
试试/usr/lib/udev/rules.d/60-net.rules