【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

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

相关推荐
yyuuuzz3 分钟前
AI模型部署中的常见稳定性问题
运维·服务器·网络·数据库·人工智能·云计算·github
ylscode3 分钟前
HexStrike AI v6.0 深度解析:MCP协议驱动的网络安全自动化框架与红队规避实战
网络·人工智能·安全·安全威胁分析
STDD4 分钟前
V Rising《夜族崛起》 专用服务器搭建教程
运维·服务器
Ameilide4 分钟前
Linux 应用软件编程 多任务并发
linux·运维·服务器
cjhbachelor7 分钟前
___信号
linux
81250353310 分钟前
第 8 篇:IP 地址:互联网的门牌号
网络·网络协议·tcp/ip
liulilittle25 分钟前
什么是“单流”?一个服务器上能不能同时存在多个“单流”?
服务器·网络·tcp/ip·计算机网络·信息与通信·tcp·通信
无限进步_32 分钟前
【Linux】环境变量:系统运行参数的“备忘录”
linux·运维·服务器
YYRAN_ZZU34 分钟前
Ubuntu22.04搭建QEMU嵌入式开发环境全攻略
linux·嵌入式硬件·ubuntu
无忧.芙桃34 分钟前
Linux信号机制(上)
linux·运维·服务器