Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
what do you mean by "on the network"? If you want to find out if the ethernet interface on your XBOX is working, You can simply looki at the corresponding LED on your switch... Or am I missing something? –  nhek Dec 8 '09 at 21:18
    
You are missing something. I clearly wouldn't be asking if I wanted to tell if my xbox was on. This is all part of a larger scheme. –  Salgar Dec 8 '09 at 22:42

4 Answers 4

up vote 2 down vote accepted

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.

share|improve this answer
    
Hi, this is great thanks, your assumptions were all correct. Your answer is especially great for telling me how to update the local arp cache. A quick ping of every IP on the local subnet works wonderfully. –  Salgar Dec 8 '09 at 23:17
    
I'm glad I could help. –  silk Dec 9 '09 at 12:26

if /proc/net/arp exists and you have grep/awk available:

mac="00:0e:a6:b6:cd:5b"
ip=$(cat /proc/net/arp | grep $mac | awk '{print$1}')
if [ "$ip" != "" ]; then
echo "It's On"
fi
share|improve this answer

Can't you just check the network settings inside the xBox 360?

Intro to Home Networking

On your Xbox 360 console, follow these steps:

  1. Select System Settings.
  2. Select Network Settings.
  3. Select Configure Network.

This will likely tell you the IP address and MAC address of the xBox 360 machine.

share|improve this answer

Are you certain that 'arp' isn't installed on your CubeStation? Might this be a path issue?

Assuming you are logging in to a shell on the CubeStation, try:

/sbin/arp

Or

/usr/sbin/arp
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.