View previous topic :: View next topic |
Author |
Message |
salam Apprentice
Joined: 29 Sep 2005 Posts: 227
|
Posted: Sun Aug 07, 2022 1:33 pm Post subject: How to identify kernel driver of virtual network device |
|
|
I'm trying to find out which kernel driver controls a network device. For physical and even virtual machine adapters, there exists a symlink
/sys/class/net/eth0/device/driver
But for virtual adapters like bridge or GRE, no such symlink is present.
Is there a way how to find out the driver name? |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3949
|
Posted: Sun Aug 07, 2022 1:58 pm Post subject: |
|
|
Quote: |
Is there a way how to find out the driver name?
|
it uses the driver of the slave ethernet device.
It might need additional .config in the kernel to enable bridge functionality but the driver is same.
In my case
Code: |
ls -l /sys/class/net/br0/lower_eth0/device/driver
|
_________________
|
|
Back to top |
|
|
salam Apprentice
Joined: 29 Sep 2005 Posts: 227
|
Posted: Mon Aug 08, 2022 7:11 pm Post subject: |
|
|
Some of them don't have lower device entry. The closest I found so far was to use /sys/class/net/*/type to get at least something useful.
I'm trying to find how to assign a device to its config entry in kernel like:
br0 -> Symbol: BRIDGE
gre1 -> Symbol: NET_IPGRE
The device name can be anything, so on an unknown system, I cannot rely on typical naming |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3949
|
Posted: Mon Aug 08, 2022 7:14 pm Post subject: |
|
|
You just use Gentoo wiki.If there is an entry there will be kernel config instructions.Look at the ebuilds.
Sometimes you can find kernel config in them too.
If not get yourself a full sample config from
https://github.com/archlinux/svntogit-packages/blob/packages/linux/trunk/config
and start grepping items.
For example if i run
Code: |
grep -i gre <some-full-.config>
|
i get
Code: |
CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
CONFIG_NET_INGRESS=y
CONFIG_NET_EGRESS=y
CONFIG_NET_IPGRE_DEMUX=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IPV6_GRE=m
CONFIG_NETFILTER_INGRESS=y
CONFIG_NETFILTER_EGRESS=y
CONFIG_NETFILTER_SKIP_EGRESS=y
CONFIG_NF_CT_PROTO_GRE=y
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_INGRESS=m
CONFIG_OPENVSWITCH_GRE=m
CONFIG_GPIO_AGGREGATOR=m
CONFIG_HID_GREENASIA=m
CONFIG_GREENASIA_FF=y
# Surface System Aggregator Module HID support
# end of Surface System Aggregator Module HID support
# CONFIG_GREYBUS is not set
CONFIG_SURFACE_AGGREGATOR_CDEV=m
CONFIG_SURFACE_AGGREGATOR_REGISTRY=m
CONFIG_SURFACE_AGGREGATOR=m
CONFIG_SURFACE_AGGREGATOR_BUS=y
# CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set
CONFIG_NLS_MAC_GREEK=m
|
filter out the junk and i have
Code: |
CONFIG_NET_IPGRE_DEMUX=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IPV6_GRE=m
CONFIG_NF_CT_PROTO_GRE=y
CONFIG_OPENVSWITCH_GRE=m
|
You get thus a rough idea of namings.
Then go to "make menuconfig" and try to find these settings. _________________
|
|
Back to top |
|
|
|