Sometimes you may want to knowLinuxSystemNicWhat driver is being used. The following describes how to solve this problem.
1. Whether it is an integrated network card or an independent network card, you must connect to the PCI bus in some way. In this case, there must be a code, which can be obtained through the following command:
# lspci | grep Ethernet 02:00.0 Ethernet controller: Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper) (rev 01)
The first ". 0" is the device code on the PCI bus, which is unique throughout the system.
2. After obtaining the PCI code of the NIC, We can find its driver in sysfs. The command is as follows:
# cd /sys/bus/pci/drivers # find | grep '02:00.0' ./e1000e/0000:02:00.0
3. Through the above command, we can find that the device is in the "e1000e" folder, that is, the NIC Driver is e1000e.
4. in Linux, find out the driver used by the NIC as follows:
# code=$(lspci | grep Ethernet | head -1 | awk '{print $1}') # find /sys/bus/pci/drivers/ | grep $code | awk -F/ '{print $6}'
Or
# find /sys/bus/pci/drivers/ | grep $(lspci | grep Ethernet | head -1 | awk '{print $1}') | awk -F/ '{print $6}'