ubuntu card Renaming

ubuntu card Renaming

Reference: https://kb.vmware.com/s/article/1032790

 

# View a list of all card 
$ ifconfig -a 

# View network device type of device configuration rules 
$ CAT /etc/udev/rules.d/70-persistent-net.rules | grep NET 

# write_net_rules execute script, this script will update / etc /udev/rules.d/70-persistent-net.rules file 
# "ethN" refers to the network card device name, for example: "eth0" 
# "xx: xx: xx: xx: xx: xx" refers to the MAC address of the network card device, For example: "00: 10: F3:. 5A: 96: 36" 
$ /etc/udev/rules.d/70-persistent-net.rules the sudo RM 
$ the sudo the INTERFACE the env = "ethN" MATCHADDR = "XX: XX: XX : xx: xx: xx "/ lib / udev / write_net_rules 


# View card name corresponding to the device MAC address 
$ ifconfig -a eth0 | grep HWaddr 

# view the card name of the device bandwidth rate 
$ ethtool eth0 | grep" link mode "

# View Card name corresponding to the device PCIID 
$ ethtool -i eth0 | grep Bus 

# view the card name of the device driver corresponding to 
$ ethtool -i eth0 | grep Driver
 
# View Card equipment PCIID
Lspci $ | grep -i eth 
# View PCIID Equipment Information 
$ lspci -n -D -s -vvv 01: 00.0 
# View the specified device ID of device information 
$ lspci -n -D -d -vvv 8086: 10FB 

# View system specify the device information 
$ udevadm info -a -p / SYS / class / NET / eth0 # reload the device rule configuration file $ sudo chmod A + the X-/etc/udev/rules.d/70-persistent-net.rules $ sudo udevadm control --reload-rules or service udev restart sudo # restart network management services # sudo service Networking restart 
# editing card configuration file 
$ sudo vi / etc / network / in the interfaces # View system routing entries $ sudo netstat -nr












 

# 网络设备信息

-------------------------------------------------------------------------------------- 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 ", the ATTR} {type ==". 1 ", KERNEL ==" Eth * ", NAME =" eth5 " $ sudo chmod a + x /etc/udev/rules.d/70- persistent-net.rules # reload the device rule configuration file $ sudo udevadm control --reload-rules 或 sudo service udev restart


 

================ End

 

Guess you like

Origin www.cnblogs.com/lsgxeva/p/10944806.html