Subject: Re: setting ethernet interface hardware address?
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-net
Date: 10/16/2001 19:09:59
> 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.)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B