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

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

[root@node-0a0a05d3-0 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-0 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-0 net]# ifconfig eth4 | grep HWaddr
eth4      Link encap:Ethernet  HWaddr A0:36:9F:C4:D4:34  
[root@node-0a0a05d3-0 net]# ifconfig eth5 | grep HWaddr
eth5      Link encap:Ethernet  HWaddr A0:36:9F:C4:D4:34  

然后看

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

 然后查看对应的设备地址

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

最后查看对应的槽位号

 

[root@node-0a0a05d3-0 ~]#  lspci -tv  
-+-[0000:ff]-+-08.0  Intel Corporation Haswell-E QPI Link 0
 |           +-08.2  Intel Corporation Haswell-E QPI Link 0
 |           +-08.3  Intel Corporation Haswell-E QPI Link 0
 |           +-09.0  Intel Corporation Haswell-E QPI Link 1
 |           +-09.2  Intel Corporation Haswell-E QPI Link 1
 |           +-09.3  Intel Corporation Haswell-E QPI Link 1
 |           +-0b.0  Intel Corporation Haswell-E R3 QPI Link 0 & 1 Monitoring
 |           +-0b.1  Intel Corporation Haswell-E R3 QPI Link 0 & 1 Monitoring
 |           +-0b.2  Intel Corporation Haswell-E R3 QPI Link 0 & 1 Monitoring
 |           +-0c.0  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.1  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.2  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.3  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.4  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.5  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.6  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.7  Intel Corporation Haswell-E Unicast Registers
 |           +-0d.0  Intel Corporation Haswell-E Unicast Registers
 |           +-0d.1  Intel Corporation Haswell-E Unicast Registers
 |           +-0f.0  Intel Corporation Haswell-E Buffered Ring Agent
 |           +-0f.1  Intel Corporation Haswell-E Buffered Ring Agent
 |           +-0f.2  Intel Corporation Haswell-E Buffered Ring Agent
 |           +-0f.3  Intel Corporation Haswell-E Buffered Ring Agent
 |           +-0f.4  Intel Corporation Haswell-E System Address Decoder & Broadcast Registers
 |           +-0f.5  Intel Corporation Haswell-E System Address Decoder & Broadcast Registers
 |           +-0f.6  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 0
 |           +-12.1  Intel Corporation Haswell-E Home Agent 0
 |           +-12.2  Intel Corporation Haswell-E Home Agent 0 Debug
 |           +-12.4  Intel Corporation Haswell-E Home Agent 1
 |           +-12.5  Intel Corporation Haswell-E Home Agent 1
 |           +-12.6  Intel Corporation Haswell-E Home Agent 1 Debug
 |           +-13.0  Intel Corporation Haswell-E Integrated Memory Controller 0 Target Address, Thermal & RAS Registers
 |           +-13.1  Intel Corporation Haswell-E Integrated Memory Controller 0 Target Address, Thermal & RAS Registers
 |           +-13.2  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel Target Address Decoder
 |           +-13.3  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel Target Address Decoder
 |           +-13.6  Intel Corporation Haswell-E DDRIO Channel 0/1 Broadcast
 |           +-13.7  Intel Corporation Haswell-E DDRIO Global Broadcast
 |           +-14.0  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel 0 Thermal Control
 |           +-14.1  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel 1 Thermal Control
 |           +-14.2  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel 0 ERROR Registers
 |           +-14.3  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel 1 ERROR Registers
 |           +-14.4  Intel Corporation Haswell-E DDRIO (VMSE) 0 & 1
 |           +-14.5  Intel Corporation Haswell-E DDRIO (VMSE) 0 & 1
 |           +-14.6  Intel Corporation Haswell-E DDRIO (VMSE) 0 & 1
 |           +-14.7  Intel Corporation Haswell-E DDRIO (VMSE) 0 & 1
 |           +-16.0  Intel Corporation Haswell-E Integrated Memory Controller 1 Target Address, Thermal & RAS Registers
 |           +-16.1  Intel Corporation Haswell-E Integrated Memory Controller 1 Target Address, Thermal & RAS Registers
 |           +-16.2  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel Target Address Decoder
 |           +-16.3  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel Target Address Decoder
 |           +-16.6  Intel Corporation Haswell-E DDRIO Channel 2/3 Broadcast
 |           +-16.7  Intel Corporation Haswell-E DDRIO Global Broadcast
 |           +-17.0  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel 0 Thermal Control
 |           +-17.1  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel 1 Thermal Control
 |           +-17.2  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel 0 ERROR Registers
 |           +-17.3  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel 1 ERROR Registers
 |           +-17.4  Intel Corporation Haswell-E DDRIO (VMSE) 2 & 3
 |           +-17.5  Intel Corporation Haswell-E DDRIO (VMSE) 2 & 3
 |           +-17.6  Intel Corporation Haswell-E DDRIO (VMSE) 2 & 3
 |           +-17.7  Intel Corporation Haswell-E DDRIO (VMSE) 2 & 3
 |           +-1e.0  Intel Corporation Haswell-E Power Control Unit
 |           +-1e.1  Intel Corporation Haswell-E Power Control Unit
 |           +-1e.2  Intel Corporation Haswell-E Power Control Unit
 |           +-1e.3  Intel Corporation Haswell-E Power Control Unit
 |           +-1e.4  Intel Corporation Haswell-E Power Control Unit
 |           +-1f.0  Intel Corporation Haswell-E VCU
 |           \-1f.2  Intel Corporation Haswell-E VCU
 +-[0000:80]-+-01.0-[81]--
 |           +-02.0-[82]--
 |           +-03.0-[83]--
 |           +-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
 +-[0000:7f]-+-08.0  Intel Corporation Haswell-E QPI Link 0
 |           +-08.2  Intel Corporation Haswell-E QPI Link 0
 |           +-08.3  Intel Corporation Haswell-E QPI Link 0
 |           +-09.0  Intel Corporation Haswell-E QPI Link 1
 |           +-09.2  Intel Corporation Haswell-E QPI Link 1
 |           +-09.3  Intel Corporation Haswell-E QPI Link 1
 |           +-0b.0  Intel Corporation Haswell-E R3 QPI Link 0 & 1 Monitoring
 |           +-0b.1  Intel Corporation Haswell-E R3 QPI Link 0 & 1 Monitoring
 |           +-0b.2  Intel Corporation Haswell-E R3 QPI Link 0 & 1 Monitoring
 |           +-0c.0  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.1  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.2  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.3  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.4  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.5  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.6  Intel Corporation Haswell-E Unicast Registers
 |           +-0c.7  Intel Corporation Haswell-E Unicast Registers
 |           +-0d.0  Intel Corporation Haswell-E Unicast Registers
 |           +-0d.1  Intel Corporation Haswell-E Unicast Registers
 |           +-0f.0  Intel Corporation Haswell-E Buffered Ring Agent
 |           +-0f.1  Intel Corporation Haswell-E Buffered Ring Agent
 |           +-0f.2  Intel Corporation Haswell-E Buffered Ring Agent
 |           +-0f.3  Intel Corporation Haswell-E Buffered Ring Agent
 |           +-0f.4  Intel Corporation Haswell-E System Address Decoder & Broadcast Registers
 |           +-0f.5  Intel Corporation Haswell-E System Address Decoder & Broadcast Registers
 |           +-0f.6  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 0
 |           +-12.1  Intel Corporation Haswell-E Home Agent 0
 |           +-12.2  Intel Corporation Haswell-E Home Agent 0 Debug
 |           +-12.4  Intel Corporation Haswell-E Home Agent 1
 |           +-12.5  Intel Corporation Haswell-E Home Agent 1
 |           +-12.6  Intel Corporation Haswell-E Home Agent 1 Debug
 |           +-13.0  Intel Corporation Haswell-E Integrated Memory Controller 0 Target Address, Thermal & RAS Registers
 |           +-13.1  Intel Corporation Haswell-E Integrated Memory Controller 0 Target Address, Thermal & RAS Registers
 |           +-13.2  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel Target Address Decoder
 |           +-13.3  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel Target Address Decoder
 |           +-13.6  Intel Corporation Haswell-E DDRIO Channel 0/1 Broadcast
 |           +-13.7  Intel Corporation Haswell-E DDRIO Global Broadcast
 |           +-14.0  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel 0 Thermal Control
 |           +-14.1  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel 1 Thermal Control
 |           +-14.2  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel 0 ERROR Registers
 |           +-14.3  Intel Corporation Haswell-E Integrated Memory Controller 0 Channel 1 ERROR Registers
 |           +-14.4  Intel Corporation Haswell-E DDRIO (VMSE) 0 & 1
 |           +-14.5  Intel Corporation Haswell-E DDRIO (VMSE) 0 & 1
 |           +-14.6  Intel Corporation Haswell-E DDRIO (VMSE) 0 & 1
 |           +-14.7  Intel Corporation Haswell-E DDRIO (VMSE) 0 & 1
 |           +-16.0  Intel Corporation Haswell-E Integrated Memory Controller 1 Target Address, Thermal & RAS Registers
 |           +-16.1  Intel Corporation Haswell-E Integrated Memory Controller 1 Target Address, Thermal & RAS Registers
 |           +-16.2  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel Target Address Decoder
 |           +-16.3  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel Target Address Decoder
 |           +-16.6  Intel Corporation Haswell-E DDRIO Channel 2/3 Broadcast
 |           +-16.7  Intel Corporation Haswell-E DDRIO Global Broadcast
 |           +-17.0  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel 0 Thermal Control
 |           +-17.1  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel 1 Thermal Control
 |           +-17.2  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel 0 ERROR Registers
 |           +-17.3  Intel Corporation Haswell-E Integrated Memory Controller 1 Channel 1 ERROR Registers
 |           +-17.4  Intel Corporation Haswell-E DDRIO (VMSE) 2 & 3
 |           +-17.5  Intel Corporation Haswell-E DDRIO (VMSE) 2 & 3
 |           +-17.6  Intel Corporation Haswell-E DDRIO (VMSE) 2 & 3
 |           +-17.7  Intel Corporation Haswell-E DDRIO (VMSE) 2 & 3
 |           +-1e.0  Intel Corporation Haswell-E Power Control Unit
 |           +-1e.1  Intel Corporation Haswell-E Power Control Unit
 |           +-1e.2  Intel Corporation Haswell-E Power Control Unit
 |           +-1e.3  Intel Corporation Haswell-E Power Control Unit
 |           +-1e.4  Intel Corporation Haswell-E Power Control Unit
 |           +-1f.0  Intel Corporation Haswell-E VCU
 |           \-1f.2  Intel Corporation Haswell-E VCU
 \-[0000:00]-+-00.0  Intel Corporation Haswell-E DMI2
             +-01.0-[02]----00.0  LSI Logic / Symbios Logic MegaRAID SAS-3 3008 [Fury]
             +-02.0-[03]----00.0  Intel Corporation Device 0953
             +-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-[04]--
             +-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 #1
             +-16.1  Intel Corporation Wellsburg MEI Controller #2
             +-1a.0  Intel Corporation Wellsburg USB Enhanced Host Controller #2
             +-1c.0-[05]--
             +-1c.7-[06-0a]----00.0-[07-0a]----00.0-[08-09]----00.0-[09]----00.0  Matrox Electronics Systems Ltd. G200eR2
             +-1d.0  Intel Corporation Wellsburg USB Enhanced Host Controller #1
             +-1f.0  Intel Corporation Wellsburg LPC Controller
             \-1f.2  Intel Corporation Wellsburg 6-Port SATA Controller [AHCI mode]

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

[root@node-0a0a05d3-0 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: 1
    Transceiver: internal
    Auto-negotiation: off
    Supports Wake-on: g
    Wake-on: d
    Current message level: 0x00000000 (0)
                   
    Link detected: yes
[root@node-0a0a05d3-0 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: 18
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: Unknown
    Supports Wake-on: g
    Wake-on: d
    Current message level: 0x00000000 (0)
                   
    Link detected: yes

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

 

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

[root@node-0a0a05d3-0 net]# lspci -vvv | grep Serial
    Capabilities: [13c v1] Device Serial Number 18-66-da-ff-fe-6f-af-9b
    Capabilities: [13c v1] Device Serial Number 18-66-da-ff-fe-6f-af-9b
    Capabilities: [13c v1] Device Serial Number 18-66-da-ff-fe-6f-af-9b
    Capabilities: [13c v1] Device Serial Number 18-66-da-ff-fe-6f-af-9b
    Capabilities: [270 v1] Device Serial Number 55-cd-2e-40-4c-71-c2-e3
    Capabilities: [140 v1] Device Serial Number a0-36-9f-ff-ff-c4-d4-34
    Capabilities: [140 v1] Device Serial Number a0-36-9f-ff-ff-c4-d4-34

 

转载于:https://www.cnblogs.com/tcicy/p/8303716.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值