I'd like to find kernel module which is behind virtual network interface (e.g interfaces using veth, dummy kernel modules, NOT physical NIC). It's easy with ethtool:

$ ethtool -i ltp_ns_veth2 |grep driver
driver: veth

But I don't want to depend on it. I know I can find module for physical NIC:

$ basename $(readlink -f /sys/class/net/eth0/device/driver/module)

But this doesn't work for virtual devices as there is no link to device folder.


You can use dmesg | grep eth if you know the interface name would contain eth.

[root@psybox ~]# dmesg | grep -i eth
[    2.009028] vmxnet3 0000:03:00.0 eth0: NIC Link is Up 10000 Mbps

The driver is displayed second, vmxnet3.

  • No, that's not correct for my case. dmesg tells you info about physical NIC (in that case is better to use info from sysfs, as I wrote in question). But dmesg does NOT tell you info about virtual NIC (NIC which use veth od dummy kernel module). – pevik Jul 26 '17 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.