MingsenLU 2012-08-13
RHEL/Linux下如何找出网卡驱动的内核模块名称
通过在dmesg里(/var/log/dmesg)查找网卡名称可得到网卡驱动的内核模块名称,适用于rhel6&5:
[root@station122 ~]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-
amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.0 (Santiago)
Release: 6.0
Codename: Santiago
[root@station122 ~]# dmesg | grep eth
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth2: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
eth0: no IPv6 routers present
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
eth0: no IPv6 routers present
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
eth0: no IPv6 routers present
e1000: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
eth1: no IPv6 routers present
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
e1000: eth2: e1000_probe: Intel(R) PRO/1000 Network Connection
eth0: no IPv6 routers present
[root@station122 ~]# cat /var/log/dmesg | grep eth
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth2: e1000_probe: Intel(R) PRO/1000 Network Connection
[root@station122 ~]#
除此之外,rhel5下还可通过查看modprobe.conf文件(rhel6已无此文件)来确定:
[root@server1 ~]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-
ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)
Release: 5.7
Codename: Carthage
[root@server1 ~]# cat /etc/modprobe.conf
alias scsi_hostadapter shpchp
alias eth0 igb
alias eth1 igb
alias eth2 igb
alias eth3 igb
alias scsi_hostadapter1 megaraid_sas
alias scsi_hostadapter2 ahci
alias scsi_hostadapter3 usb-storage
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1
[root@server1 ~]# lsmod | grep igb
igb 143512 0
dca 6133 2 igb,ioatdma
[root@server1 ~]# cat /var/log/dmesg | grep eth
igb 0000:01:00.0: eth0: (PCIe:2.5Gb/s:Width x2) 00:21:28:e7:84:5c
igb 0000:01:00.0: eth0: PBA No: 1040FF-0FF
igb 0000:01:00.1: eth1: (PCIe:2.5Gb/s:Width x2) 00:21:28:e7:84:5d
igb 0000:01:00.1: eth1: PBA No: 1040FF-0FF
igb 0000:07:00.0: eth2: (PCIe:2.5Gb/s:Width x2) 00:21:28:e7:84:5e
igb 0000:07:00.0: eth2: PBA No: 1040FF-0FF
igb 0000:07:00.1: eth3: (PCIe:2.5Gb/s:Width x2) 00:21:28:e7:84:5f
igb 0000:07:00.1: eth3: PBA No: 1040FF-0FF
[root@server1 ~]# modinfo igb
filename: /lib/modules/2.6.32-200.13.1.el5uek/kernel/drivers/net/igb/igb.ko
version: 3.0.6-k2
license: GPL
description: Intel(R) Gigabit Ethernet Network Driver
author: Intel Corporation, <[email protected]>
srcversion: 4FCA773FBC764EC20495F89
...