How do I find out my Ethernet address?

Charles Noren noren at dinl.uucp
Fri May 4 22:59:34 AEST 1990


Thanks to the dozens of replies.  There are many ways to "skin the cat"
on this question.  I haven't tried all of them, but here's a list of
some of the many ways:

  arp(8):  arp -a, or pipe it to grep with hostname just to get
  the hostname address, for example: arp -a | grep dinl

  ifconfig(8)
  
  grep `hostname` /etc/hosts   (for IP address only).

  /etc/dmesg|grep Ethernet, or dmesg | grep Ethernet   if path is set right.

  grep Ethernet /var/adm/messages* | tail -1    (for your hardware address)

  grep `hostname` /etc/hosts | tail -1  (for the IP address)

  rsh machine2 ping machine1 \; arp machine1

  Look in /var/adm/messages. It has copies of all messages output to
  the console during logins.

  Go to another machine on the same local net, ping it to make sure its
  alive, then enter:  arp hostname, where hostname is the name of your
  machine.

  If your network administrator maintains the "ethers" yellow pages
  database, it's as simple as typing "ypmatch `hostname` ethers".

  If above not true, you can write a trivial utility in C which uses the
  library function ether_hostton().  See the ethers(3N) man page.

Thanks again for all the replies!

-- 
Chuck Noren
NET:     ncar!dinl!noren
US-MAIL: Martin Marietta I&CS, MS XL8058, P.O. Box 1260,
         Denver, CO 80201-1260
Phone:   (303) 971-7930



More information about the Comp.unix.questions mailing list