Tuesday, October 9, 2018

How to find network card driver name and version on Linux


For network interface card (NIC) hardware to operate properly, you need a suitable device driver for the NIC hardware. A NIC device driver implements a hardware-independent common interface between the Linux kernel and the NIC, so that packets can be moved between the kernel and the NIC. While some drivers may be statically built in the kernel, most drivers for modern NICs are dynamically loaded as kernel modules.

When you are troubleshooting a NIC hardware problem, one thing you can do is to check whether a correct network adapter driver is installed properly. In this case, you need to know which kernel module is your NIC driver.

There are several ways to find the name/version of an Ethernet card driver on Linux.

Method One
The first method is to to check dmesg messages. Since the kernel loads necessary hardware drivers during boot, dmesg output should tell if an Ethernet card driver is installed.
$ dmesg | grep -i ethernet

The above output shows that a driver named tg3 is loaded in the kernel.

If you want to know more detail about this driver (e.g., driver version), you can use modinfo command.
$ modinfo tg3
If dmesg does not print any information about Ethernet driver, that means no suitable network device driver is available on your system.

Method Two
The second method is to use the ethtool command. To find out the driver name for an interface eth0, run the following.
$ ethtool -i eth0

Method Three
Another useful tool for NIC driver information is lshw. Type the following command to get detailed information about available Ethernet card(s) and their driver.
$ sudo lshw -class network
In the lshw output, look for the "capabilities" line, and examine "driver" and "driverversion" in the line.

If no suitable NIC driver is installed on your system, the driver field will remain empty.
Share:

0 comments:

Post a Comment