Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!dinl!noren From: noren@dinl.uucp (Charles Noren) Newsgroups: comp.unix.questions Subject: Re: How do I find out my Ethernet address? Message-ID: <1612@dinl.mmc.UUCP> Date: 4 May 90 12:59:34 GMT References: <1606@dinl.mmc.UUCP> <2561@syma.sussex.ac.uk> Reply-To: noren@dinl.UUCP (Charles Noren) Organization: Martin Marietta I&CS, Denver CO. Lines: 40 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