RHEL6.x查看网卡槽位对应设备文件及路径

先查看网卡mac地址,由于我的服务器做了mac地址绑定,所以会有相同的hwaddr地址,请忽略。

[root@node-0a0a05d3- net]# ifconfig eth0 | grep HWaddr
eth0 Link encap:Ethernet HWaddr 18:66:DA:6F:AF:9B
[root@node-0a0a05d3-0 net]# ifconfig eth1 | grep HWaddr
eth1 Link encap:Ethernet HWaddr 18:66:DA:6F:AF:9B
[root@node-0a0a05d3- net]# ifconfig eth2 | grep HWaddr
eth2 Link encap:Ethernet HWaddr 18:66:DA:6F:AF:9F
[root@node-0a0a05d3-0 net]# ifconfig eth3 | grep HWaddr
eth3 Link encap:Ethernet HWaddr 18:66:DA:6F:AF:9F
[root@node-0a0a05d3- net]# ifconfig eth4 | grep HWaddr
eth4 Link encap:Ethernet HWaddr A0:36:9F:C4:D4:34
[root@node-0a0a05d3- net]# ifconfig eth5 | grep HWaddr
eth5 Link encap:Ethernet HWaddr A0:36:9F:C4:D4:34

然后看

[root@node-0a0a05d3- ~]# cd /sys/class/net
[root@node-0a0a05d3- net]# cat ./eth0/address
::da:6f:af:9b
[root@node-0a0a05d3- net]# cat ./eth1/address
::da:6f:af:9b
[root@node-0a0a05d3- net]# cat ./eth2/address
::da:6f:af:9f
[root@node-0a0a05d3- net]# cat ./eth3/address
::da:6f:af:9f
[root@node-0a0a05d3- net]# cat ./eth4/address
a0::9f:c4:d4:
[root@node-0a0a05d3- net]# cat ./eth5/address
a0::9f:c4:d4:

然后查看对应的设备地址

[root@node-0a0a05d3- net]# ll
total
lrwxrwxrwx root root Jan : bond0 -> ../../devices/virtual/net/bond0
lrwxrwxrwx root root Jan : bond1 -> ../../devices/virtual/net/bond1
lrwxrwxrwx root root Jan : bond2 -> ../../devices/virtual/net/bond2
-rw-r--r-- root root Jan : bonding_masters
lrwxrwxrwx root root Jan : br_ceph -> ../../devices/virtual/net/br_ceph
lrwxrwxrwx root root Jan : br_cluster -> ../../devices/virtual/net/br_cluster
lrwxrwxrwx root root Jan : br_ex -> ../../devices/virtual/net/br_ex
lrwxrwxrwx root root Jan : br_ex-lb -> ../../devices/virtual/net/br_ex-lb
lrwxrwxrwx root root Jan : br_ipmi -> ../../devices/virtual/net/br_ipmi
lrwxrwxrwx root root Jan : br_mon -> ../../devices/virtual/net/br_mon
lrwxrwxrwx root root Jan : eth0 -> ../../devices/pci0000:00/0000:00:03.0/0000:01:00.0/net/eth0
lrwxrwxrwx root root Jan : eth1 -> ../../devices/pci0000:00/0000:00:03.0/0000:01:00.1/net/eth1
lrwxrwxrwx root root Jan : eth2 -> ../../devices/pci0000:00/0000:00:03.0/0000:01:00.2/net/eth2
lrwxrwxrwx root root Jan : eth3 -> ../../devices/pci0000:00/0000:00:03.0/0000:01:00.3/net/eth3
lrwxrwxrwx root root Jan : eth4 -> ../../devices/pci0000:80/0000:80:03.2/0000:84:00.0/net/eth4
lrwxrwxrwx root root Jan : eth5 -> ../../devices/pci0000:80/0000:80:03.2/0000:84:00.1/net/eth5
lrwxrwxrwx root root Jan : lb-br_ex -> ../../devices/virtual/net/lb-br_ex
lrwxrwxrwx root root Jan : lo -> ../../devices/virtual/net/lo

最后查看对应的槽位号

[root@node-0a0a05d3- ~]#  lspci -tv
-+-[:ff]-+-08.0 Intel Corporation Haswell-E QPI Link
| +-08.2 Intel Corporation Haswell-E QPI Link
| +-08.3 Intel Corporation Haswell-E QPI Link
| +-09.0 Intel Corporation Haswell-E QPI Link
| +-09.2 Intel Corporation Haswell-E QPI Link
| +-09.3 Intel Corporation Haswell-E QPI Link
| +-0b. Intel Corporation Haswell-E R3 QPI Link & Monitoring
| +-0b. Intel Corporation Haswell-E R3 QPI Link & Monitoring
| +-0b. Intel Corporation Haswell-E R3 QPI Link & Monitoring
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0d. Intel Corporation Haswell-E Unicast Registers
| +-0d. Intel Corporation Haswell-E Unicast Registers
| +-0f. Intel Corporation Haswell-E Buffered Ring Agent
| +-0f. Intel Corporation Haswell-E Buffered Ring Agent
| +-0f. Intel Corporation Haswell-E Buffered Ring Agent
| +-0f. Intel Corporation Haswell-E Buffered Ring Agent
| +-0f. Intel Corporation Haswell-E System Address Decoder & Broadcast Registers
| +-0f. Intel Corporation Haswell-E System Address Decoder & Broadcast Registers
| +-0f. Intel Corporation Haswell-E System Address Decoder & Broadcast Registers
| +-10.0 Intel Corporation Haswell-E PCIe Ring Interface
| +-10.1 Intel Corporation Haswell-E PCIe Ring Interface
| +-10.5 Intel Corporation Haswell-E Scratchpad & Semaphore Registers
| +-10.6 Intel Corporation Haswell-E Scratchpad & Semaphore Registers
| +-10.7 Intel Corporation Haswell-E Scratchpad & Semaphore Registers
| +-12.0 Intel Corporation Haswell-E Home Agent
| +-12.1 Intel Corporation Haswell-E Home Agent
| +-12.2 Intel Corporation Haswell-E Home Agent Debug
| +-12.4 Intel Corporation Haswell-E Home Agent
| +-12.5 Intel Corporation Haswell-E Home Agent
| +-12.6 Intel Corporation Haswell-E Home Agent Debug
| +-13.0 Intel Corporation Haswell-E Integrated Memory Controller Target Address, Thermal & RAS Registers
| +-13.1 Intel Corporation Haswell-E Integrated Memory Controller Target Address, Thermal & RAS Registers
| +-13.2 Intel Corporation Haswell-E Integrated Memory Controller Channel Target Address Decoder
| +-13.3 Intel Corporation Haswell-E Integrated Memory Controller Channel Target Address Decoder
| +-13.6 Intel Corporation Haswell-E DDRIO Channel / Broadcast
| +-13.7 Intel Corporation Haswell-E DDRIO Global Broadcast
| +-14.0 Intel Corporation Haswell-E Integrated Memory Controller Channel Thermal Control
| +-14.1 Intel Corporation Haswell-E Integrated Memory Controller Channel Thermal Control
| +-14.2 Intel Corporation Haswell-E Integrated Memory Controller Channel ERROR Registers
| +-14.3 Intel Corporation Haswell-E Integrated Memory Controller Channel ERROR Registers
| +-14.4 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-14.5 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-14.6 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-14.7 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-16.0 Intel Corporation Haswell-E Integrated Memory Controller Target Address, Thermal & RAS Registers
| +-16.1 Intel Corporation Haswell-E Integrated Memory Controller Target Address, Thermal & RAS Registers
| +-16.2 Intel Corporation Haswell-E Integrated Memory Controller Channel Target Address Decoder
| +-16.3 Intel Corporation Haswell-E Integrated Memory Controller Channel Target Address Decoder
| +-16.6 Intel Corporation Haswell-E DDRIO Channel / Broadcast
| +-16.7 Intel Corporation Haswell-E DDRIO Global Broadcast
| +-17.0 Intel Corporation Haswell-E Integrated Memory Controller Channel Thermal Control
| +-17.1 Intel Corporation Haswell-E Integrated Memory Controller Channel Thermal Control
| +-17.2 Intel Corporation Haswell-E Integrated Memory Controller Channel ERROR Registers
| +-17.3 Intel Corporation Haswell-E Integrated Memory Controller Channel ERROR Registers
| +-17.4 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-17.5 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-17.6 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-17.7 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-1e. Intel Corporation Haswell-E Power Control Unit
| +-1e. Intel Corporation Haswell-E Power Control Unit
| +-1e. Intel Corporation Haswell-E Power Control Unit
| +-1e. Intel Corporation Haswell-E Power Control Unit
| +-1e. Intel Corporation Haswell-E Power Control Unit
| +-1f. Intel Corporation Haswell-E VCU
| \-1f. Intel Corporation Haswell-E VCU
+-[:]-+-01.0-[]--
| +-02.0-[]--
| +-03.0-[]--
| +-03.2-[84]--+-00.0 Intel Corporation Ethernet 10G 2P X520 Adapter
| | \-00.1 Intel Corporation Ethernet 10G 2P X520 Adapter
| +-05.0 Intel Corporation Haswell-E Address Map, VTd_Misc, System Management
| +-05.1 Intel Corporation Haswell-E Hot Plug
| +-05.2 Intel Corporation Haswell-E RAS, Control Status and Global Errors
| \-05.4 Intel Corporation Haswell-E I/O Apic
+-[:7f]-+-08.0 Intel Corporation Haswell-E QPI Link
| +-08.2 Intel Corporation Haswell-E QPI Link
| +-08.3 Intel Corporation Haswell-E QPI Link
| +-09.0 Intel Corporation Haswell-E QPI Link
| +-09.2 Intel Corporation Haswell-E QPI Link
| +-09.3 Intel Corporation Haswell-E QPI Link
| +-0b. Intel Corporation Haswell-E R3 QPI Link & Monitoring
| +-0b. Intel Corporation Haswell-E R3 QPI Link & Monitoring
| +-0b. Intel Corporation Haswell-E R3 QPI Link & Monitoring
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0c. Intel Corporation Haswell-E Unicast Registers
| +-0d. Intel Corporation Haswell-E Unicast Registers
| +-0d. Intel Corporation Haswell-E Unicast Registers
| +-0f. Intel Corporation Haswell-E Buffered Ring Agent
| +-0f. Intel Corporation Haswell-E Buffered Ring Agent
| +-0f. Intel Corporation Haswell-E Buffered Ring Agent
| +-0f. Intel Corporation Haswell-E Buffered Ring Agent
| +-0f. Intel Corporation Haswell-E System Address Decoder & Broadcast Registers
| +-0f. Intel Corporation Haswell-E System Address Decoder & Broadcast Registers
| +-0f. Intel Corporation Haswell-E System Address Decoder & Broadcast Registers
| +-10.0 Intel Corporation Haswell-E PCIe Ring Interface
| +-10.1 Intel Corporation Haswell-E PCIe Ring Interface
| +-10.5 Intel Corporation Haswell-E Scratchpad & Semaphore Registers
| +-10.6 Intel Corporation Haswell-E Scratchpad & Semaphore Registers
| +-10.7 Intel Corporation Haswell-E Scratchpad & Semaphore Registers
| +-12.0 Intel Corporation Haswell-E Home Agent
| +-12.1 Intel Corporation Haswell-E Home Agent
| +-12.2 Intel Corporation Haswell-E Home Agent Debug
| +-12.4 Intel Corporation Haswell-E Home Agent
| +-12.5 Intel Corporation Haswell-E Home Agent
| +-12.6 Intel Corporation Haswell-E Home Agent Debug
| +-13.0 Intel Corporation Haswell-E Integrated Memory Controller Target Address, Thermal & RAS Registers
| +-13.1 Intel Corporation Haswell-E Integrated Memory Controller Target Address, Thermal & RAS Registers
| +-13.2 Intel Corporation Haswell-E Integrated Memory Controller Channel Target Address Decoder
| +-13.3 Intel Corporation Haswell-E Integrated Memory Controller Channel Target Address Decoder
| +-13.6 Intel Corporation Haswell-E DDRIO Channel / Broadcast
| +-13.7 Intel Corporation Haswell-E DDRIO Global Broadcast
| +-14.0 Intel Corporation Haswell-E Integrated Memory Controller Channel Thermal Control
| +-14.1 Intel Corporation Haswell-E Integrated Memory Controller Channel Thermal Control
| +-14.2 Intel Corporation Haswell-E Integrated Memory Controller Channel ERROR Registers
| +-14.3 Intel Corporation Haswell-E Integrated Memory Controller Channel ERROR Registers
| +-14.4 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-14.5 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-14.6 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-14.7 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-16.0 Intel Corporation Haswell-E Integrated Memory Controller Target Address, Thermal & RAS Registers
| +-16.1 Intel Corporation Haswell-E Integrated Memory Controller Target Address, Thermal & RAS Registers
| +-16.2 Intel Corporation Haswell-E Integrated Memory Controller Channel Target Address Decoder
| +-16.3 Intel Corporation Haswell-E Integrated Memory Controller Channel Target Address Decoder
| +-16.6 Intel Corporation Haswell-E DDRIO Channel / Broadcast
| +-16.7 Intel Corporation Haswell-E DDRIO Global Broadcast
| +-17.0 Intel Corporation Haswell-E Integrated Memory Controller Channel Thermal Control
| +-17.1 Intel Corporation Haswell-E Integrated Memory Controller Channel Thermal Control
| +-17.2 Intel Corporation Haswell-E Integrated Memory Controller Channel ERROR Registers
| +-17.3 Intel Corporation Haswell-E Integrated Memory Controller Channel ERROR Registers
| +-17.4 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-17.5 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-17.6 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-17.7 Intel Corporation Haswell-E DDRIO (VMSE) &
| +-1e. Intel Corporation Haswell-E Power Control Unit
| +-1e. Intel Corporation Haswell-E Power Control Unit
| +-1e. Intel Corporation Haswell-E Power Control Unit
| +-1e. Intel Corporation Haswell-E Power Control Unit
| +-1e. Intel Corporation Haswell-E Power Control Unit
| +-1f. Intel Corporation Haswell-E VCU
| \-1f. Intel Corporation Haswell-E VCU
\-[:]-+-00.0 Intel Corporation Haswell-E DMI2
+-01.0-[]----00.0 LSI Logic / Symbios Logic MegaRAID SAS- [Fury]
+-02.0-[]----00.0 Intel Corporation Device
+-03.0-[01]--+-00.0 Broadcom Corporation NetXtreme II BCM57800 1/10 Gigabit Ethernet
| +-00.1 Broadcom Corporation NetXtreme II BCM57800 1/10 Gigabit Ethernet
| +-00.2 Broadcom Corporation NetXtreme II BCM57800 1/10 Gigabit Ethernet
| \-00.3 Broadcom Corporation NetXtreme II BCM57800 1/10 Gigabit Ethernet
+-03.2-[]--
+-05.0 Intel Corporation Haswell-E Address Map, VTd_Misc, System Management
+-05.1 Intel Corporation Haswell-E Hot Plug
+-05.2 Intel Corporation Haswell-E RAS, Control Status and Global Errors
+-05.4 Intel Corporation Haswell-E I/O Apic
+-11.0 Intel Corporation Wellsburg SPSR
+-11.4 Intel Corporation Wellsburg sSATA Controller [AHCI mode]
+-16.0 Intel Corporation Wellsburg MEI Controller #
+-16.1 Intel Corporation Wellsburg MEI Controller #
+-1a. Intel Corporation Wellsburg USB Enhanced Host Controller #
+-1c.-[]--
+-1c.-[-0a]----00.0-[-0a]----00.0-[-]----00.0-[]----00.0 Matrox Electronics Systems Ltd. G200eR2
+-1d. Intel Corporation Wellsburg USB Enhanced Host Controller #
+-1f. Intel Corporation Wellsburg LPC Controller
\-1f. Intel Corporation Wellsburg -Port SATA Controller [AHCI mode]

还可以通过以下命令来进一步确认

[root@node-0a0a05d3- net]# ethtool eth1
Settings for eth1:
Supported ports: [ FIBRE ]
Supported link modes: 1000baseT/Full
10000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: No
Advertised link modes: 10000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 10000Mb/s
Duplex: Full
Port: Direct Attach Copper
PHYAD:
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: g
Wake-on: d
Current message level: 0x00000000 () Link detected: yes
[root@node-0a0a05d3- net]# ethtool eth2
Settings for eth2:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD:
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: d
Current message level: 0x00000000 () Link detected: yes

如果够勤快的话就直接插拔网线看就ok了,其中Link detected: yes是一个参考项,当然我都是直接ifconfig看up/down ^_^

据说lspci也可以查看,不过我没找到对应的关系,具体lspci的命令还是值得研究的~~

[root@node-0a0a05d3- net]# lspci -vvv | grep Serial
Capabilities: [13c v1] Device Serial Number --da-ff-fe-6f-af-9b
Capabilities: [13c v1] Device Serial Number --da-ff-fe-6f-af-9b
Capabilities: [13c v1] Device Serial Number --da-ff-fe-6f-af-9b
Capabilities: [13c v1] Device Serial Number --da-ff-fe-6f-af-9b
Capabilities: [ v1] Device Serial Number -cd-2e--4c--c2-e3
Capabilities: [ v1] Device Serial Number a0--9f-ff-ff-c4-d4-
Capabilities: [ v1] Device Serial Number a0--9f-ff-ff-c4-d4-
上一篇:javascript(基础)_对数组的遍历方法总结(find, findIndex, forEach,)


下一篇:word2007中如何隐藏工具栏