我正在运行 Debian 9。我一直在关注本指南分配手动网络接口名称。我创建了两个文件:
$ cat /etc/systemd/network/20-wlan0.link
[Match]
MACAddress=e0:94:67:0a:aa:f0
[Link]
Name=wlan0
$ cat /etc/systemd/network/50-eth0.link
[Match]
MACAddress=3c:97:0e:06:f0:44
[Link]
Name=eth0
重新启动系统后,只有 Wi-Fi 卡的接口被重命名:
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether 3c:97:0e:06:f0:44 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
link/ether e0:94:67:0a:aa:f0 brd ff:ff:ff:ff:ff:ff
udevadm info -e
向我展示:
P: /devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlan0
E: DEVPATH=/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlan0
E: DEVTYPE=wlan
E: ID_BUS=pci
E: ID_MM_CANDIDATE=1
E: ID_MODEL_FROM_DATABASE=Centrino Wireless-N 1000 [Condor Peak] (Centrino Wireless-N 1000 BGN)
E: ID_MODEL_ID=0x0084
E: ID_NET_NAME_MAC=wlxe094670aaaf0
E: ID_NET_NAME_PATH=wlp3s0
E: ID_OUI_FROM_DATABASE=Intel Corporate
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Network controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_VENDOR_ID=0x8086
E: IFINDEX=3
E: INTERFACE=wlan0
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/wlan0
E: TAGS=:systemd:
E: USEC_INITIALIZED=4041253
P: /devices/pci0000:00/0000:00:19.0/net/enp0s25
E: DEVPATH=/devices/pci0000:00/0000:00:19.0/net/enp0s25
E: ID_BUS=pci
E: ID_MM_CANDIDATE=1
E: ID_MODEL_FROM_DATABASE=82579LM Gigabit Network Connection
E: ID_MODEL_ID=0x1502
E: ID_NET_DRIVER=e1000e
E: ID_NET_LINK_FILE=/etc/systemd/network/50-eth0.link
E: ID_NET_NAME_MAC=enx3c970e06f044
E: ID_NET_NAME_PATH=enp0s25
E: ID_OUI_FROM_DATABASE=Wistron InfoComm(Kunshan)Co.,Ltd.
E: ID_PATH=pci-0000:00:19.0
E: ID_PATH_TAG=pci-0000_00_19_0
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_VENDOR_ID=0x8086
E: IFINDEX=2
E: INTERFACE=enp0s25
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp0s25
E: TAGS=:systemd:
E: USEC_INITIALIZED=1776573
哪里可以明显看出。关联文件已加载,但由于某些未知原因,接口未重命名。您知道出了什么问题以及如何调试吗?