Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've to setup a bunch of servers, and I need to discover their MAC addresses with the following setup:

MacBookPro >----------< Server 

The Macbook Pro is directly connected (not behind a router/switch) to the server. I've no clue about the IP address the server is using as default setup, and I can't use a display connected to the server to display its network card configuration.

How can I discover the MAC address of the server network card? I'm looking for a command line tool. If something exists in MacPort it's also ok.

share|improve this question
up vote 1 down vote accepted

If your MacBook Pro is directly connected to the server with an Ethernet cable (no other machines on the network) then you could just leave tcpdump running, showing source MAC addresses that are not your own. Just copy/paste this into Terminal:

MYMACTOIGNORE=`ifconfig en0 | grep ether | awk '{print $2}'`
echo "My own MAC address, to ignore, appears to be '$MYMACTOIGNORE'"
sudo tcpdump -pnei en0 not ether src $MYMACTOIGNORE |  awk '{print $2}'

On modern computers, anytime you plug in an Ethernet, it's going to send a fair number of frames out, mostly multicasts and broadcasts, to do things like get a DHCP lease, verify it can use the IP address it wants to use, find its router, announce services it's offering, and check for other devices offering services it's interested in.

Just leave this running in a Terminal window as you plug your MBP into each server, and you'll see its MAC address show up in your Terminal window. Hit Cmd-K between servers to clear your Terminal window if you want to make it even more clear which MAC address is from the current server.

share|improve this answer

Since you don't know the IP address of the server, you don't even know that it's in the same IP subnet as your MacBookPro. So, I would suggest you start with tcpdump in order to discover what the remote IP is. If you see that the server is in the same IP subnet than your MacBookPro, you'll be able to send a ping and then have a look at your ARP cache. If you server is in another subnet or uses VLAN tagged packets, you might have to change your MacBookPros network settings before going any further.

share|improve this answer

How about:

ping -c 1 server
arp server
share|improve this answer
OK, missed the fact that you don't know the IP configuration. How about setting the Macbook netmask to, ping, arp -a ? – coneslayer Apr 1 '10 at 12:09
As an honored member of Super User, please consider revising your answer to provide more detail. – KronoS Jul 13 '12 at 4:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .