在Linux系统中,可以通过以下几种方法查看网卡型号:
一、使用lspci命令(适用于PCI网卡)
lspci
是一个用于显示系统中PCI总线设备的工具。它可以列出连接到PCI总线的各种设备信息,包括网卡。lspci | grep -i net
。这个命令的含义是在lspci
输出的所有PCI设备信息中,通过grep
命令过滤出包含“net”(网络)关键字的行,这些行通常包含了网卡的相关信息,其中就包括网卡型号。例如,可能会看到类似00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (2) I219 - V
这样的输出,其中“Intel Corporation Ethernet Connection (2) I219 - V”就是网卡型号。二、使用ethtool命令(需要先安装ethtool)
ethtool
是一个用于查询和控制以太网设备的工具。它可以获取网卡的详细信息,如速度、双工模式、MAC地址以及型号等。ethtool
。如果没有安装,可以使用包管理器进行安装,例如在基于Debian或Ubuntu的系统中,可以使用sudo apt - get install ethtool
命令安装。ethtool -i eth0
(假设网卡的接口名称为eth0
,如果有多个网卡,可能是eth1
、enp0s3
等)。这个命令会显示网卡的驱动信息、版本、固件版本以及网卡型号等内容。例如:Settings for eth0:
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
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto - negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto - negotiation: on
MDI - X: off (auto)
Supports Wake - on: pumbg
Wake - on: d
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
Driver: e1000e
Version: 3.2.6.2
Firmware version: 0.13.2
Bus info: PCI@0000:00:19.0
supports-statistics: yes
supports - test: yes
supports - eeprom - access: yes
supports - wake - on: pumbg
其中“Driver”后面的名称是网卡驱动名称,“Firmware version”是固件版本等信息,可以根据这些信息进一步确定网卡型号或者查询相关资料获取型号。
三、查看/proc/pci文件(较老的方法)
/proc/pci
文件包含了系统中PCI设备的信息。这是一种比较底层的查看方式,需要对PCI设备结构有一定的了解。cat /proc/pci | grep Ethernet
。这个命令会显示/proc/pci
文件中包含“Ethernet”关键字的行,这些行包含了网卡的相关信息,包括网卡型号等。不过这种方法输出的信息格式相对复杂,可能需要更多的解读。例如可能会看到类似00:19.00 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)
这样的输出,其中“Intel Corporation 82579LM Gigabit Network Connection”就是网卡型号。领取专属 10元无门槛券
手把手带您无忧上云