Subject: Re: Ethernet [MAC] addresses
To: None <port-i386@netbsd.org>
From: T@W <lsp93@xs4all.nl>
List: port-i386
Date: 02/26/2001 21:19:09
>Can somebody enlighten me: is it possible to change the
>ethernet [MAC, ie xx.xx.xx.xx.xx.xx] address of a network
>interface?
>
>It looks [from the ifconfig(8) manpage] like setting the
>ethernet address  should be possible in a similar way to
>setting IP address, but I can't seem to figure out the
>syntax.  [On linux boxen, I've previously done this with the
>"hw" option to ifconfig]
>
----------------------------------------------------------------
Some time ago there was a discussion on the OpenBSD platform about this so
I've included an excerpt of a utility to set the MAC address on an
interface.
Has this one been ported to NetBSD yet?

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
/*  sea.c, v 1.0a2 1998/10/05 lone_wolf */

/*
 *  sea.c : set ethernet interface addresses on openbsd
 *  Copyright (c) 1998 lone_wolf (Fredrik Widlund) <fw@921i.se>
 *
[snip]
/*
 *  sea.c : set ethernet interface addresses on openbsd
 *
 *  Changes the hardware address for ethernet interface(s) on OpenBSD.
 *  Requires securelevel 0 to write to kernel memory.
 *
 *  Don't know which ethernet chips it will work on.
 *
 *  Takes affect instantly, which might confuse other hosts arp databases.
 *  Clearing the arp table will make us promote it in arp requests. Guess
 *  we should broadcast-publish ourself=8A
 *
 *  If you want to run it interactively (ie. not script it in /etc/rc) you
 *  must recompile a kernel with 'option insecure' in it, to allow the
 *  securelevel to remain at zero altitude.
 *
 *  Oh btw, this is not standard procedure. Dont blame me if it takes down
 *  your system. It is for OpenBSD *exclusively*. Try it on other platforms
 *  and they will most certainly crash.
 *
 *  Hacked if_ethersubr to keep mr. bsd off the eh for af_unspec, then
 *  noticed that the exact (letter for letter) patch had been used a year
 *  ago, for a couple of months, until deraadt ruled it out=8A I'll keep it
 *  though. It's still in the cvs tree, of course. Try it out.
 *
 *  v1.0a2 is hackerished and actually quite improved=8A
 *
 *  This is still fresh code, and probably filled with annoying creatures=8A

[snip]
I still have the mailfile so if anybody wants it let me know or do a search
for it on the OpenBSD archives etc.

BTW for why anybody wants to do this: remember the time that people had
privacyconcerns with PIII IDnumbers?
Same goes for encapsulating the MAC in traffic-headers.
Nad because nobody seems to protest about IPv6, which I think is rather
sad.there's a need for tools like that.

T@W

"Plato's Parameters"

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
NOTICE TO BULK E-MAILERS:
Pursuant to EU Code, Title 47, Chapter 5, Subchapter II, 227,
and all nonsolicited commercial e-mail sent to this address is
subject to a download and archival fee in the amount of 1500 EURO.
__
Pursuant to Europe Code Section 17538.4
(c) Upon notification by a recipient of his or her request not
to receive any further unsolicited faxed OR ELECTRONICALLY MAILED
documents, no person or entity conducting business in this state
shall fax or cause to be faxed OR ELECTRONICALLY MAIL OR CAUSE TO BE
ELECTRONICALLY MAILED any unsolicited documents to that recipient.
(d) Any violation of subdivision (c) is an infraction punishable by
a fine of one thousand five hundred eurodollars (=851500) for each and every
transmission.
--