是否可以找到有关Linux卡的详细信息?
例如我们尝试过:
dmidecode | grep -i network
Function key-initiated network boot is supported
Port Type: Network Port
Port Type: Network Port
Port Type: Network Port
Port Type: Network Port
# dmidecode | grep -i eth
Type: Ethernet
Type: Ethernet
Type: Ethernet
Type: Ethernet
此详细信息没有提及有关网卡和性能等的任何内容。
对于可以提供有关网卡的这些详细信息的工具有什么建议吗?
答案1
为了获取网卡的品牌/型号,通常您运行:
$ lspci | grep -i Ethernet
02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
或者获取 NIC 的更多详细信息:
$ sudo lshw -class network
*-network
description: Ethernet interface
product: 82545EM Gigabit Ethernet Controller (Copper)
vendor: Intel Corporation
physical id: 1
bus info: pci@0000:02:01.0
logical name: eth0
version: 01
serial: 00:0c:29:25:4d:0e
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 66MHz
capabilities: pm pcix bus_master cap_list rom ethernet physical logical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full ip=192.168.5.143 latency=0 link=yes mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:19 memory:fd5c0000-fd5dffff memory:fdff0000-fdffffff ioport:2000(size=64) memory:fd500000-fd50ffff
Greppingdmesg
网络设备也可能有帮助:
$ dmesg | grep eth0
[ 1.635942] e1000 0000:02:01.0 eth0: (PCI:66MHz:32-bit) 00:0c:29:25:4d:0e
[ 1.635960] e1000 0000:02:01.0 eth0: Intel(R) PRO/1000 Network Connection
[ 3.736090] e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
[ 3.742639] 8021q: adding VLAN 0 to HW filter on device eth0
至于dmidecode
,dmidecode -t baseboard
可能会显示有关主板内置网卡的信息。
PS 至于 Unix SE 问题,在处理硬件问题时,完整的lscpi
输出可能更有用。
答案2
您可以使用ethtool
它为您提供有关卡的更多信息,还可以控制网络驱动程序和硬件设置。
例如:
# ethtool enp0s31f6
Settings for enp0s31f6:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: on (auto)
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x0000ffff (65535)
drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol 0x8000
Link detected: yes