以下是我的部分输出ip addr show
10: ge4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether 02:00:00:00:00:06 brd ff:ff:ff:ff:ff:ff
11: ge44: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN
link/ether 02:00:00:00:00:32 brd ff:ff:ff:ff:ff:ff
12: ge45: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
link/ether 02:00:00:00:00:33 brd ff:ff:ff:ff:ff:ff
输出/sys/class/net
如下
/sys/class/net> ll
total 0
lrwxrwxrwx 1 root root 0 May 21 20:35 bond0 -> ../../devices/virtual/net/bond0
lrwxrwxrwx 1 root root 0 May 21 20:35 bond1 -> ../../devices/virtual/net/bond1
-rw-r--r-- 1 root root 4096 May 21 20:35 bonding_masters
lrwxrwxrwx 1 root root 0 May 21 20:34 eth0 -> ../../devices/fsl,dpaa.22/ethernet.23/net/eth0
lrwxrwxrwx 1 root root 0 May 21 20:34 eth1 -> ../../devices/fsl,dpaa.22/ethernet.24/net/eth1
lrwxrwxrwx 1 root root 0 May 21 20:34 eth2 -> ../../devices/fsl,dpaa.22/ethernet.25/net/eth2
lrwxrwxrwx 1 root root 0 May 21 20:44 ge4 -> ../../devices/virtual/net/ge4
lrwxrwxrwx 1 root root 0 May 21 21:15 ge44 -> ../../devices/virtual/net/ge44
lrwxrwxrwx 1 root root 0 May 21 21:15 ge45 -> ../../devices/virtual/net/ge45
lrwxrwxrwx 1 root root 0 May 21 20:34 gre0 -> ../../devices/virtual/net/gre0
lrwxrwxrwx 1 root root 0 May 21 20:34 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx 1 root root 0 May 21 20:34 sit0 -> ../../devices/virtual/net/sit0
lrwxrwxrwx 1 root root 0 May 21 20:34 tunl0 -> ../../devices/virtual/net/tunl0
我尝试为 udev 添加新的规则文件,然后重新启动 udev,但更改仍然没有反映出来。我希望将 ge44 和 ge45 名称更改为“alpha0”和“alpha1”之类的名称。
有任何提示我该如何实现这一点吗?
编辑:
我修改了规则文件如下
cat /etc/udev/rules.d/80-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="02:00:00:00:00:32", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="alpha0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="02:00:00:00:00:33", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="alpha1"
答案1
在我看来,这些接口就像虚拟接口。您在系统上运行任何虚拟机吗?接口通常以/etc/network/interfaces
(Debian 样式) 或/etc/sysconfig/network-scripts/ifcfg-<ifname>
(Red Hat 样式) 定义,对于虚拟接口(如 Xen 创建的接口),它们可以在 VM 的配置文件中找到。