How to determine the driver used by the NIC in Linux

Source: Internet
Author: User

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}'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.