Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Apr 2006 14:16:01 -0400
From:      Mike Meyer <mwm-keyword-freebsdhackers.102a7e@mired.org>
To:        Darren Pilgrim <darren.pilgrim@bitfreak.org>
Cc:        hackers@freebsd.org
Subject:   Re: Using any network interface whatsoever (solution?)
Message-ID:  <17465.20321.174794.576853@bhuda.mired.org>
In-Reply-To: <4438A0A3.3050600@bitfreak.org>
References:  <C05CAC06.C0BD%ceri@submonkey.net> <20060407225742.GA21619@odin.ac.hmc.edu> <20060407230247.GH16344@submonkey.net> <4437C9F6.5000008@samsco.org> <17463.65076.117616.563302@bhuda.mired.org> <20060408224140.GA15366@outcold.yadt.co.uk> <17464.17494.251794.271711@bhuda.mired.org> <44385525.8000203@bitfreak.org> <17464.31976.938131.944829@bhuda.mired.org> <4438A0A3.3050600@bitfreak.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In <4438A0A3.3050600@bitfreak.org>, Darren Pilgrim <darren.pilgrim@bitfreak.org> typed:
> Mike Meyer wrote:
> > In <44385525.8000203@bitfreak.org>, Darren Pilgrim <darren.pilgrim@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@mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?17465.20321.174794.576853>