Using any network interface whatsoever (solution?)

Mike Meyer mwm-keyword-freebsdhackers.102a7e at mired.org
Sun Apr 9 18:16:03 UTC 2006


In <4438A0A3.3050600 at bitfreak.org>, Darren Pilgrim <darren.pilgrim at bitfreak.org> typed:
> Mike Meyer wrote:
> > In <44385525.8000203 at bitfreak.org>, Darren Pilgrim <darren.pilgrim at bitfreak.org> typed:
[Tying names to MAC addresses.]
> >> That's far better than trying to remember what's on em0.
> > 
> > That's certainly true. But is there an advantage to tieing the
> > PublicLAN name to a MAC address as opposed to em0?
> You could test two different drivers on the same hardware and you wouldn't 
> have to duplicate or modify your ifconfig lines in /etc/rc.conf, just run:

Yup, and this is an advantage. On the other hand, if you tie the
device name to the slot number (the real goal), you can swap different
hardware into that slot without having to modify any configuration
information at all. If you tie the name to the MAC address, you always
have to change that part of the config. If you tie the name to the
current name, then you only have to change it if you change drivers.

> Within the currently available capabilities, we get the network interface 
> equivalent of disk volume labels.

Not quite. With volume labels, I can arrange to keep a replicated
drive with the same volume label, and can plug it in if the old drive
fails without changing a single line of system configuration. Using
the MAC address as the key requires that you reconfigure the name
mapping (unless you have cards that let you change the MAC address,
though I have no idea if those exist for any platform that FreeBSD
runs on).

> [ Proposed use of PCI addresses instead of MAC addresses. ]
> > The real problem with what I proposed is that you have to arrange to
> > search config information for things that may not be tied to a pci
> > bus. That could get real messy.
> Right, it doesn't scale to ISA or USB devices.  The prior probably isn't a 
> big deal these days, but I imagine compatibility with USB devices is fairly 
> important.

>From what Warner Losh posted (thanks for some hard data, Warner), the
PCI address isn't fixed, though you're less likely to run into it
moving. And Bruce Simpson (thanks Bruce) tells us that the solution I
want - names based on slot addresses - is only available on some
hardware, at least for now.

There's no reason we can't extend your basic solution to handle
configuration by either driver/number or MAC address, allowing the
user to pick the properties they want for their names.

Of course, this doesn't help the OP's problem of wanting to be able to
address the sole interface in a system without knowing it's name in
advance. Maybe a feature to provide a default name for an interface if
one isn't found in the config file would do that.

BTW, I'd like to point out that sound cards have the same problem,
only they all get the same "driver" name. Worse yet, the numbering can
change between reboots (at least, it could on 4.x).

	<mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.


More information about the freebsd-hackers mailing list