网络接口命名冲突 ubuntu

网络接口命名冲突 ubuntu

我最近更改了哪些接口是 NIC 绑定的成员。我进行调整的第一台 ubuntu 服务器运行良好,但第二台服务器遇到了问题。Ifconfig 显示存在“rename2”接口。我该如何解决这一切?

查看 udev 规则的输出,我希望“eth2”和“eth0”成为绑定的成员。

编辑:好的,Matt 的以下修复暂时解决了这个问题。几次重启后它又会出现,我必须重复这个过程!有什么想法吗?

这是 /etc/udev/rules.d/70-persistant-net.rules 文件

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x10ec:/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="a0:f3:c1:00:a0:7a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:99:13:0c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:1c.5/0000:03:00.0 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:99:13:0d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

我的 /etc/network/interfaces

#loopback network interface
auto lo
iface lo inet loopback

# The primary network interface

auto eth2
iface eth2 inet manual
bond-master bond0

auto eth1
iface eth1 inet static
address 10.1.10.199
netmask 255.255.255.0
gateway 10.1.10.1
dns-nameservers 8.8.8.8 8.8.4.4

auto eth0
iface eth0 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
address 192.168.1.2
netmask 255.255.255.0
#bond mode 0 is rr
bond-mode balance-rr
bond-miimon 100
bond-slaves none
mtu 9000

配置文件

bond0     Link encap:Ethernet  HWaddr 00:25:90:99:13:0d  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::225:90ff:fe99:130d/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:9000  Metric:1
          RX packets:5236 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3265 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:782916 (782.9 KB)  TX bytes:395078 (395.0 KB)

eth1      Link encap:Ethernet  HWaddr 00:25:90:99:13:0c  
          inet addr:10.1.10.199  Bcast:10.1.10.255  Mask:255.255.255.0
          inet6 addr: fe80::225:90ff:fe99:130c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10277 errors:0 dropped:415 overruns:0 frame:0
          TX packets:4073 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1384868 (1.3 MB)  TX bytes:540020 (540.0 KB)
          Interrupt:16 Memory:fe9e0000-fea00000 

eth2      Link encap:Ethernet  HWaddr 00:25:90:99:13:0d  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:9000  Metric:1
          RX packets:5236 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3265 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:782916 (782.9 KB)  TX bytes:395078 (395.0 KB)
          Interrupt:17 Memory:feae0000-feb00000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:123 errors:0 dropped:0 overruns:0 frame:0
          TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:12570 (12.5 KB)  TX bytes:12570 (12.5 KB)

rename2   Link encap:Ethernet  HWaddr 00:25:90:99:13:0c  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

猫/ var / log / syslog | grep -i eth

Feb 27 14:42:42 emtestserver2 kernel: [    1.707645] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
Feb 27 14:42:42 emtestserver2 kernel: [    1.708359] r8169 0000:01:00.0: eth0: RTL8168e/8111e at 0xf8410000, 00:25:90:99:13:0c, XID 0c200000 IRQ 43
Feb 27 14:42:42 emtestserver2 kernel: [    1.708390] r8169 0000:01:00.0: eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
Feb 27 14:42:42 emtestserver2 kernel: [    1.835800] e1000e 0000:02:00.0: eth1: (PCI Express:2.5GT/s:Width x1) 00:25:90:99:13:0c
Feb 27 14:42:42 emtestserver2 kernel: [    1.835830] e1000e 0000:02:00.0: eth1: Intel(R) PRO/1000 Network Connection
Feb 27 14:42:42 emtestserver2 kernel: [    1.835935] e1000e 0000:02:00.0: eth1: MAC: 3, PHY: 8, PBA No: 0101FF-0FF
Feb 27 14:42:42 emtestserver2 kernel: [    1.943729] e1000e 0000:03:00.0: eth2: (PCI Express:2.5GT/s:Width x1) 00:25:90:99:13:0d
Feb 27 14:42:42 emtestserver2 kernel: [    1.943759] e1000e 0000:03:00.0: eth2: Intel(R) PRO/1000 Network Connection
Feb 27 14:42:42 emtestserver2 kernel: [    1.943863] e1000e 0000:03:00.0: eth2: MAC: 3, PHY: 8, PBA No: 0101FF-0FF
Feb 27 14:42:42 emtestserver2 kernel: [    8.009312] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Feb 27 14:42:42 emtestserver2 kernel: [    8.009330] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
Feb 27 14:42:42 emtestserver2 kernel: [    8.009345] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
Feb 27 14:42:42 emtestserver2 kernel: [    8.090179] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Feb 27 14:42:42 emtestserver2 kernel: [    8.505554] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
Feb 27 14:42:42 emtestserver2 kernel: [   10.229052] e1000e: eth1 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
Feb 27 14:42:42 emtestserver2 kernel: [   10.229064] e1000e 0000:02:00.0: eth1: 10/100 speed: disabling TSO
Feb 27 14:42:42 emtestserver2 kernel: [   10.229637] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
Feb 27 14:44:10 emtestserver2 udevd[399]: error changing net interface name rename2 to eth1: File exists
Feb 27 14:51:45 emtestserver2 kernel: [    1.726543] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
Feb 27 14:51:45 emtestserver2 kernel: [    1.727347] r8169 0000:01:00.0: eth0: RTL8168e/8111e at 0xf8422000, 00:25:90:99:13:0c, XID 0c200000 IRQ 46
Feb 27 14:51:45 emtestserver2 kernel: [    1.727377] r8169 0000:01:00.0: eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
Feb 27 14:51:45 emtestserver2 kernel: [    1.835779] e1000e 0000:02:00.0: eth1: (PCI Express:2.5GT/s:Width x1) 00:25:90:99:13:0c
Feb 27 14:51:45 emtestserver2 kernel: [    1.835809] e1000e 0000:02:00.0: eth1: Intel(R) PRO/1000 Network Connection
Feb 27 14:51:45 emtestserver2 kernel: [    1.835914] e1000e 0000:02:00.0: eth1: MAC: 3, PHY: 8, PBA No: 0101FF-0FF
Feb 27 14:51:45 emtestserver2 kernel: [    1.947925] e1000e 0000:03:00.0: eth2: (PCI Express:2.5GT/s:Width x1) 00:25:90:99:13:0d
Feb 27 14:51:45 emtestserver2 kernel: [    1.947957] e1000e 0000:03:00.0: eth2: Intel(R) PRO/1000 Network Connection
Feb 27 14:51:45 emtestserver2 kernel: [    1.948088] e1000e 0000:03:00.0: eth2: MAC: 3, PHY: 8, PBA No: 0101FF-0FF
Feb 27 14:51:45 emtestserver2 kernel: [    7.896332] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Feb 27 14:51:45 emtestserver2 kernel: [    7.896349] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
Feb 27 14:51:45 emtestserver2 kernel: [    7.896363] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
Feb 27 14:51:45 emtestserver2 kernel: [    8.030196] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Feb 27 14:51:45 emtestserver2 kernel: [    8.257699] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
Feb 27 14:51:45 emtestserver2 kernel: [    8.877181] bonding: bond0: Adding slave eth2.
Feb 27 14:51:45 emtestserver2 kernel: [    8.953427] bonding: bond0: enslaving eth2 as an active interface with a down link.
Feb 27 14:51:45 emtestserver2 kernel: [    9.028338] e1000e 0000:03:00.0: eth2: changing MTU from 1500 to 9000
Feb 27 14:51:45 emtestserver2 kernel: [   10.013072] e1000e: eth1 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
Feb 27 14:51:45 emtestserver2 kernel: [   10.013088] e1000e 0000:02:00.0: eth1: 10/100 speed: disabling TSO
Feb 27 14:51:45 emtestserver2 kernel: [   10.013786] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
Feb 27 14:51:47 emtestserver2 kernel: [   11.741054] e1000e: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
Feb 27 14:51:47 emtestserver2 kernel: [   11.780038] bonding: bond0: link status definitely up for interface eth2, 1000 Mbps full duplex.
Feb 27 14:53:13 emtestserver2 udevd[411]: error changing net interface name rename2 to eth1: File exists
Feb 27 14:53:13 emtestserver2 kernel: [   98.504821] bonding: bond0: Interface eth0 does not exist!

答案1

备份文件 70-persistent-net.rules。然后清除 70-persistent-net.rules,使其中没有任何条目。重新启动。

重新启动后验证它现在看起来是否正常。

我记得如果持久网络规则存在任何问题(例如 MAC 地址不同),它就会创建这些重命名适配器。几个月前我确实遇到过类似的事情,清除这个文件有所帮助。

另外,在我的系统中,绑定正在工作,我首先列出绑定接口,如下所示。不确定这是否会让事情对你来说更好。

auto bond0
iface bond0 inet static
  address 192.168.1.2
  network 192.168.1.0
  netmask 255.255.255.0
  bond-slaves none
  bond-mode 4
  bond-mmimon 100
  bond-lacp-rate 1

auto eth0
iface eth0 inet manual
  bond-master bond0
  bond-primary eth0 eth1

auto eth1
iface eth1 inet manual
  bond-master bond0
  bond-primary eth0 eth1

相关内容