I've a question: What is the best way to map network devices name to
their associated module names?
By this, I mean mapping network devices as they appear in "ifconfig"
(eth0, eth1, eth2, ppp0, tr0, and so on) to the names of the
appropriate kernel modules for each driver (such as eepro100, e1000,
3c509, and so on).
I know about /etc/modules.conf, but the alias mappings in there are
only shortcuts to make usage more convenient. They are not binding.
For example, if the user insmod's a module into memory manually, it
may allocate some network devices for itself that do not appear in
this file. Since Linux allocates network device names in strict
numerical sequence, it could cause mass confusion if their order gets
Is there a way to see, for sure, what the kernel currently considers
to be the mapping of device names to modules?
This would be a boon to GUI configuration tools, which currently have
to guess (by scanning modules.conf, the /etc/sysconfig directory on
Red Hat, the MAC addresses of cards, or some other heuristic).
Perhaps a /proc file, perhaps /proc/net/devices, with a format like
# ifindex devname modname modinstance
1 eth0 eepro100 0
2 eth1 eepro100 1
3 eth2 e1000 0
This is a system with a localhost device compiled directly into the
kernel (so no module information is available), two eepro100 cards
installed, and one e1000 card installed.
"ifindex" is the interface index, used with traditional ioctl() calls
such as SIOCGIFCONF.
"devname" is the device name, as it appears to the user tools
"modname" is the name of that interface's device driver module. If a
device has been compiled directly into the kernel, it is blank.
"modinstance" is the internal number of the interface, as used within
the driver for that device. This could be useful when passing command
line configuration parameters to a module that supports multiple
cards, to see which card actually corresponds to which parameter
Does something like this already exist?
To me, this seems useful, and easy to add. I could probably code up a
quick patch to implement this if anyone is interested.
krellan -=at=- krellan =-dot-= com
(Please use this address to avoid spam-filtering)