Subject: Re: setting ethernet interface hardware address?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Nick Amato <>
List: tech-net
Date: 10/16/2001 22:47:17
On Tue, Oct 16, 2001 at 07:09:59PM -0400, der Mouse wrote:
> > Is it possible to set the link layer address on NICs in NetBSD?
> It depends on the NIC.  Much - most? all? - hardware supports this,
> though with varying degrees of ease.
> I don't think any drivers currently support it; I certainly know of
> none.  For a past project, I had occasion to add a kernel-compile-time
> option to cause one driver to override the MAC address read from the
> card, but it was a major kludge, and worked for that driver only.
> Given a reasonably well-thought-out interface, I would guess that
> most-to-all ethernet interfaces could be made to handle it.
> Of course, if you want to do it for non-Ethernets, it gets more
> interesting.  Not all network interfaces have software-settable
> link-layer addresses; a simple example is SLIP/PPP, for which
> link-layer addressing is entirely implicit.
> I'd love to see a good interface design for this.  Especially if it
> also allows fetching the link-layer address; the project I alluded to
> above also had occasino to want to fetch an interface's MAC address,
> and I found it really gross that I couldn't do that without assuming
> something about some other address family.  (The program was
> AF_INET-dependent anyway, so it wasn't a practical issue, just an
> aesthetic one.)

It's also worth noting that allowing configuration of MAC address
"aliases", where supported by the hardware, would be a nice feature.
This makes implementing something like VRRP (RFC 2338) much easier.

Nick Amato