【Linux】如何查看网卡驱动

如何查看网卡驱动?

要查看机器的网卡驱动程序,您可以使用以下几种方法。这些方法可以帮助您查找并识别当前正在使用的网卡驱动程序。

方法1:使用 ethtool

ethtool 可以显示网络接口的详细信息,包括驱动程序名称。

sh 复制代码
sudo ethtool -i <interface_name>

例如:

sh 复制代码
sudo ethtool -i eth0

输出示例:

复制代码
driver: e1000e
version: 3.2.6-k
firmware-version: 0.13-3
expansion-rom-version: 
bus-info: 0000:00:19.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

方法2:使用 lshw

lshw 工具可以列出所有硬件设备,包括网络设备及其驱动程序。

sh 复制代码
sudo lshw -class network

输出示例:

复制代码
  *-network
       description: Ethernet interface
       product: Ethernet Connection I217-LM
       vendor: Intel Corporation
       physical id: 19
       bus info: pci@0000:00:19.0
       logical name: eth0
       version: 04
       serial: 00:1a:2b:3c:4d:5e
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=0.13-3 ip=192.168.1.2 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:20 memory:f7e00000-f7e1ffff memory:f7e3d000-f7e3dfff ioport:f080(size=32)

configuration 部分,可以看到 driverdriverversion 字段。

方法3:使用 lspci

lspci 命令可以列出 PCI 设备,通过该命令结合 grep 可以找到网卡信息。

sh 复制代码
lspci -v | grep -i ethernet

输出示例:

复制代码
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I217-LM (rev 04)
        Subsystem: Lenovo ThinkPad T440p
        Flags: bus master, fast devsel, latency 0, IRQ 45
        Memory at f7e00000 (32-bit, non-prefetchable) [size=128K]
        Memory at f7e3d000 (32-bit, non-prefetchable) [size=4K]
        I/O ports at f080 [size=32]
        Capabilities: [c8] Power Management version 2
        Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [e0] PCI Advanced Features
        Kernel driver in use: e1000e
        Kernel modules: e1000e

Kernel driver in use 字段中显示了当前使用的驱动程序。

方法4:使用 /sys/class/net

在 Linux 系统中,您还可以通过读取 /sys/class/net 文件系统中的文件来查看网卡驱动程序的信息。

sh 复制代码
cat /sys/class/net/<interface_name>/device/driver/module

例如:

sh 复制代码
cat /sys/class/net/eth0/device/driver/module

输出会显示驱动程序模块的路径,例如:

复制代码
/sys/module/e1000e

总结来说,这几种方法都可以用来查看系统当前网卡使用的驱动程序。选择最适合您的方法来获取所需的信息。

相关推荐
章老师说8 小时前
BFE v1.8.3 正式发布:AI网关能力再升级,企业级七层负载均衡持续进化
运维·人工智能·负载均衡
天空'之城15 小时前
Linux 系统编程 22:五种 IO 模型全解
linux
小张成长计划..17 小时前
【Linux】10:冯·诺依曼体系结构和操作系统
linux·运维·服务器
赛博三把手18 小时前
Claude Fable 5 API 调用完整指南:官方、AWS、OpenRouter 与中转平台对比(2026 最新)
网络·云计算·aws
悦儿遥遥雨120 小时前
PXE + Kickstart 无人值守批量部署系统
linux·javascript·nginx
Imagine Miracle21 小时前
【WSL】让WSL2后台持久运行不自动关闭的解决方案
linux·windows·wsl
兔C21 小时前
Linux 命令行入门学习资料 day_2
linux·运维·服务器
eggcode21 小时前
Linux命令基础与操作技巧
linux
二宝哥1 天前
VMware Workstation 实战:CentOS 7.9 安装、桥接网络配置与克隆管理详解
linux·centos·vmware
枕星而眠1 天前
【数据结构】红黑树入门指南
运维·数据结构·c++·后端