Subject: Re: Changing MAC addresses?
To: None <port-alpha@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-alpha
Date: 06/15/2000 15:28:31
I wrote a note to port-alpha about changing the MAC address used by de0
and/or ex0.  This produced quite a bunch of responses; herewith a
collection of relevant bits and my own replies to them.

> If I'm correct, MAC addresses are hardwired into the chips on any
> network interface.

This may be true of some, but certainly not "any".  Certainly Suns
dating from before their cutover to PCI all have their MAC address in
the NVRAM, stuffed into the network interfaces at boot time.  (Yes,
this means a single MAC address per machine, rather than per interface;
this is allowed - it's a comparatively little-known aspect of the
Ethernet spec.)

> Why change the MAC address anyway?  I'm confused there...

Most briefly, I want to make the machine capable of speaking something
compatible with Cisco's EtherChannel.  But this means that all
interfaces participating in the bonded interface must accept packets
for the same MAC address.

For the sake of making it work, I'm beginning to think I'll have to
just throw the chips into promiscuous mode; since they're talking to a
switch rather than hub, this shouldn't cause reception of too much
stray traffic.  But I'd still rather hack the Ethernet drivers to avoid
going promiscuous.

> Are you going to be adding facilities to the kernel so that we can
> set hardware-level addresses for an interface in the same way that we
> can set higher-level addresses?

I wasn't intending to, but if enough Ethernet drivers come to support
doing this, a userland interface to it certainly could be added.

> On boxes running OpenVMS, the Ethernet interface has to allow the MAC
> address to be changed in order to support DECnet.

That was true of Phase IV, but I thought Phase V didn't demand that
capability any longer.  (Unless I have the numbers wrong and they
should be Phase III and Phase IV - it's been too long.)

>> Why change the MAC address anyway?
> So that a router won't be surprised at the sudden change in MAC
> address for a given host.

Or that, yeah. :)

> - or perhaps it would be more correct to say there has to be a way to
> set an *additional* MAC address - the original MAC address from the
> chip isn't changed.

Yes; as you can see from the above, the ability to set an additional
unicast address would be sufficient for my purposes; there's no real
need to disable the original.

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B