Linux – way to determine if a certain MAC address is on the local network from a Synology Cubestation, which doesn’t have arp

linuxmac addressnetwork-attached-storagenetworking

I have a bit of a strange problem, I am trying to determine if a certain MAC address (my xbox 360) is on the network (i.e. on)

The problem is i'm doing it from my Synology Cubestation, which is a powerpc based NAS with an embedded Linux.

I have access to a variety of commands including ping and nslookup, but i do not have things like arp which would be most useful.

I don't mind doing something like pinging everything from 192.168.1.1 to 192.168.1.255, but that doesn't return the mac address. unfortunately my knowledge of the Linuxy network commands are limited so any suggestions welcome.

P.S. if there is another way to determine if my xbox is on the network, those suggestions are welcome too.

Best Answer

First, few assumptions:

  • you want to do that programatically, and not looking at the leds
  • you don't know the current IP of xbox
  • you know the subnet that dhcp gives IPs from

To list IP/MACs currently known to system: cat /proc/net/arp

So you would have to ping every IP from the subnet, then check the arp table, and to be sure ping the IP.

Something like:

ping -c 1 `cat arp | grep "00:12:34:45:78:AB" | cut -d" " -f 1` >/dev/null; echo $?

Will output 0 if Xbox is answering to pings, and 1 otherwise. Depending on what you want to do, you can do some if on $? or something.