70-persistent-net.rules 未得到遵守

70-persistent-net.rules 未得到遵守

这是 PXE 安装,之前是 14.04。我将其移至 18.04,大多数事情都正常,但出于某种原因,只有其中一条规则/etc/udev/rules.d/70-persistent-net.rules(由预置脚本自动生成)得到遵守。

/etc/udev/rules.d/70-persistent-net.rules

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="40:8d:5c:5c:df:ce", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="ctrl1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="68:05:ca:22:c6:0b", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="data1"

/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ctrl1
iface ctrl1 inet dhcp

auto data1
iface data1 inet static
    address    10.255.01.13
    netmask    255.255.255.240
    network    10.255.01.0
    broadcast  10.255.01.255

ifconfig 输出:

foo@bar:~# ifconfig
data1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet xx.xx.xx.xx  netmask 255.255.255.240  broadcast 10.255.1.255
        inet6 fe80::6a05:caff:fe22:c60b  prefixlen 64  scopeid 0x20<link>
        ether 68:05:ca:22:c6:0b  txqueuelen 1000  (Ethernet)
        RX packets 123  bytes 10749 (10.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 3772 (3.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 17  memory 0xdc040000-dc060000  

enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet xx.xx.xx.xx  netmask 255.255.255.128  broadcast 192.168.166.255
        inet6 fe80::428d:5cff:fe5c:dfce  prefixlen 64  scopeid 0x20<link>
        ether 40:8d:5c:5c:df:ce  txqueuelen 1000  (Ethernet)
        RX packets 966  bytes 89471 (89.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 701  bytes 391743 (391.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xdc100000-dc120000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 697  bytes 57332 (57.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 697  bytes 57332 (57.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

data1可以,但是ctrl1尚未设置。

有任何想法吗?

相关内容