【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

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

相关推荐
发光小北3 小时前
Modbus TCP 转 Profinet 主站网关如何应用?
网络·网络协议·tcp/ip
wanhengidc5 小时前
云手机 高振畅玩不踩坑
运维·服务器·安全·web安全·智能手机
有谁看见我的剑了?6 小时前
linux 添加硬盘后系统识别不到硬盘处理
linux·运维·服务器
JoyCong19986 小时前
ToDesk远程屏幕墙技术白皮书:如何重塑全局运维视界
运维·电脑·远程工作
易连EDI—EasyLink6 小时前
易连EDI–EasyLink实现OCR智能数据采集
网络·人工智能·安全·汽车·ocr·edi
偶尔上线经常挺尸6 小时前
《100个“反常识”经验15:Nginx 502排查:从应用到内核》
运维·nginx·性能调优·反向代理·502错误·http排错
@insist1236 小时前
信息安全工程师考点精讲:身份认证核心原理与分类体系(上篇)
大数据·网络·分类·信息安全工程师·软件水平考试
SmartRadio7 小时前
ESP32-S3 双模式切换实现:兼顾手机_路由器连接与WiFi长距离通信
开发语言·网络·智能手机·esp32·长距离wifi
_.Switch7 小时前
东方财富股票数据JS逆向:secids字段和AES加密实战
开发语言·前端·javascript·网络·爬虫·python·ecmascript
yc_12247 小时前
用 Visual Studio 远程调试 Linux:从零到流畅的完整指南
linux·ide·visual studio