# 网络设备信息 --------------------------------------------------------------------------------------
name type MATCHADDR Bandwidth PCIID driver device
--------------------------------------------------------------------------------------
eth0 Ethernet 00:13:32:0e:2a:60 1000baseT/Full 0000:05:00.0 e1000e 8086:10d3
eth1 Ethernet 00:13:32:0e:2a:61 1000baseT/Full 0000:06:00.0 e1000e 8086:10d3
eth2 Ethernet 00:13:32:0e:2a:62 1000baseT/Full 0000:07:00.0 e1000e 8086:10d3
eth3 Ethernet 00:13:32:0e:2a:63 1000baseT/Full 0000:08:00.0 e1000e 8086:10d3
--------------------------------------------------------------------------------------
eth4 Ethernet 00:10:f3:5a:96:36 10000baseT/Full 0000:01:00.0 ixgbe 8086:10fb
eth5 Ethernet 00:10:f3:5a:96:37 10000baseT/Full 0000:01:00.1 ixgbe 8086:10fb
--------------------------------------------------------------------------------------
# 将设备MAC地址与ethN接口名称相关联
$ sudo vi cat 70-persistent-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 0x8086:10d3 (e1000e) --- 05:00.0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:32:0e:2a:60", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:10d3 (e1000e) --- 06:00.0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:32:0e:2a:61", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:10d3 (e1000e) --- 07:00.0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:32:0e:2a:62", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x8086:10d3 (e1000e) --- 08:00.0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:32:0e:2a:63", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# PCI device 0x8086:0x10fb (ixgbe) --- 01:00.0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:10:f3:5a:96:36", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
# PCI device 0x8086:0x10fb (ixgbe) --- 01:00.1
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:10:f3:5a:96:37", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"
# 将设备PCI总线地址与ethN接口名称相关联
$ sudo vi cat 70-persistent-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 0x8086:10d3 (e1000e) --- 05:00.0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", %B=="0000:05:00.0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:10d3 (e1000e) --- 06:00.0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", %B=="0000:06:00.0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:10d3 (e1000e) --- 07:00.0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", %B=="0000:07:00.0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x8086:10d3 (e1000e) --- 08:00.0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", %B=="0000:08:00.0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# PCI device 0x8086:0x10fb (ixgbe) --- 01:00.0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", %B=="0000:01:00.0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
# PCI device 0x8086:0x10fb (ixgbe) --- 01:00.1
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", %B=="0000:01:00.1", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"
# 重新加载设备规则配置文件
$ sudo chmod a+x /etc/udev/rules.d/70-persistent-net.rules
$ sudo udevadm control --reload-rules 或 sudo service udev restart
|