Subject: Re: D-Link DFE-670TXD
To: None <netbsd-help@NetBSD.org>
From: Soren Jacobsen <snj@pobox.com>
List: netbsd-help
Date: 11/26/2003 13:37:48
On 11/26 10:08, Keith Parker wrote:
> I am looking forward to the day that I know enough to be as 
> helpful/encouraging to someone else, and I thought I might start 
> contributing by mentioning that the MAC address can be determined w/NetBSD 
> by using the dmesg output.
> 
> A quick way would be to type:
> 
> dmesg | grep MAC
> and
> dmesg | grep Ethernet
> 
> Funkily, I noticed that one of my NICs referred to it's MAC address with 
> the "Ethernet Address" synonym, so you'd need to type both commands to be 
> sure you get all adapters.
> 
> Alternatively, you could just type:
> dmesg | grep address   and throw out the 2 or 3 extraneous entries that 
> have nothing to do with NICs.

If you don't mind, I'd like to make a couple comments about this. The
first is that the system message buffer often gets overwritten during
the uptime of a system. For instance, I've got a few lines of:

nfs server 192.168.0.7:/usr/pkgsrc: not responding
nfs server 192.168.0.7:/usr/pkgsrc: is alive again

in my buffer. If I got a lot more of those messages, the hardware probe
info that you expect to find would be pushed off. So instead of "dmesg |
grep" you ought to just grep /var/run/dmesg.boot.

The second thing is that ifconfig presents the information in a much
nicer way. Something like "ifconfig <interface> | awk '/address:/ {print
$2}' would work nicely.

Happy MAC address retrieving!