Linux查看网卡是千兆仍是万兆网卡

目前用过的两个命令:web

一、ethtool

语法:ethtool 网络接口名网络

#ethtool em4

Settings for em4:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
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: Yessvg

Speed: 1000Mb/s

Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: d
Link detected: yesxml

二、lspci

当前是博通BCM5709千兆网卡Gigabit(万兆网卡显示为10-Gigabit)接口

#lspci -vvv | grep Ethernet

01:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 GigabitEthernet (rev 20)
Subsystem: Dell PowerEdge R710 BCM5709 Gigabit Ethernet
Product Name: Broadcom NetXtreme II Ethernet Controller
01:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
Subsystem: Dell PowerEdge R710 BCM5709 Gigabit Ethernet
Product Name: Broadcom NetXtreme II Ethernet Controller
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
Subsystem: Dell PowerEdge R710 BCM5709 Gigabit Ethernet
Product Name: Broadcom NetXtreme II Ethernet Controller
02:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
Subsystem: Dell PowerEdge R710 BCM5709 Gigabit Ethernet
Product Name: Broadcom NetXtreme II Ethernet Controller
pcilib: sysfs_read_vpd: read failed: Connection timed outci

小知识:rem

一、Gigabit是数据存储的单位,一般用符号Gbit或Gb表示。它的换算公式:1 Gb = 10的9次方 bits = 1,000,000,000 bits 。
二、另外一个常见的单位是Gibibit,gibibit是用来表示二进制换算的,1 gibibit = 2的30次方 bits = 1,073,741,824 bits。it