Detecting a Beaglebone IP Addtress

Board members:

I’ve got an interesting problem that I’m trying to come up with a solution for. I am going to be teaching a class next quarter on the Beaglebone Black. Students will attach their bones to a network and program them remotely over ethernet. Code will be developed on a virtual machine running Linux and then connected via sftp to the board. However, the students will only have a bone and a prototyping cape available to them. WHat I am trying to figure out is the best way for them to determine the IP address of their board. By default, I know that the boards use dhcp to get an ip address. However, without a display, it’s somewhat hard to get an ip address. Is there an easy way, maybe by using the usb connection, that students can figure out the IP address of the board so they can remote to it in an appropriate fashion. I’ve thought about simply pinging the boards, but with multiple boards on the network, that would only indicate that a board is connected, not that their board is connected. I suppose I could go to fixed IP’s, but that would require them to change the SD card, which at first I’d rather use “stock” until they have gotten their feet wet.

Any ideas or suggestions?



PS: We’ll be using a Debian image based of of Robert Nelson’s work unless a new “standard” image comes out from Circuitco before then.

Most DHCP servers will record the ethernet MAC address of each IP number assignment and try to assign the same IP when they see that MAC address again. That lets node users determine their DHCP-assigned IP address once and assume they will get that same IP address when they attach to the network again. But if there are a lot of nodes that come and go, the DHCP server might have to reuse IP numbers. If your students are connecting to a network with a lot of laptops, workstations, and BBBs, I think the probability of such mixups is high.

I would avoid relying on this, and setup the BBBs to use their own fixed IP addresses. Maybe that could be their first exercise? Or maybe you could just do it before the quarter starts, assuming you have all the BBBs. As soon as you connect a Beaglebone Black to a Windows PC with the flash-resident drivers, it brings up a USB serial port emulation. You can use any free terminal program (like Tera Term) to log into the BBB. From there it is pretty easy to set it to use a fixed IP address whenever it boots. Derek Molloy has a YouTube video that details this. Once they have each done that, then SSH and SFTP and an ethernet cable is all they need to talk to their boards.

I think this would also present some advantages for you as the instructor: Every student’s network activity would be very easy to track, if they all use assigned IP numbers.

Hi Walter,

This would depend on your setup, but some routers can be configured to issue a fixed IP based on a Mac address.


I agree, creating host entries on your DHCP server to provide a fixed iP
address based on the MAC address of the board is probably the easiest
solution. If you've got DDNS setup, you could register a MAC address
based hostname when they get their IP w/o having to create static host
entries for each board (a problem if you are frequently getting new
boards or have more boards than available IP addresses).


I’m kind of a newbie on all this (so use at your own risk) but I would consider:

  1. A unique hostname for each board and then each student could ping hostname for their BBB which should return the IP address [Reply from 192.168. … ] (?)
  2. Have a boot script write the ip address to a file onto a thumb drive which they could pop into a laptop after the BBB booted
  3. Have a boot script mail the ip address to their email account
  4. Have a boot script print their name/hostname/ip address to a printer (not very enviromentally friendly)
  5. Get them to learn morse code and have a boot script flash the LEDs in morse code :wink:

… best regards,

Thanks for all of the responses. A couple of additional aspects to the problem:

#1 I don’t have access to the routers to adjust their setup, as that is controlled by our IT department that doesn’t want to deal with configuration in that manner.
#2 Students may work at home / dorms with a different network confiuration.

I’m entrigued by the idea of writing the IP address to a file at boot. If I did that, then I probably could connect via usb and read that file back. I’ll have to try that and see if I can get that working reliably.

I’ve also thought about a program that blinked the lights on the board to display the ip, but I’;m not sure that will be reliable either. (Hint: Maybe that would be a cool heartbeat to build into the onboard leds for this reason.)


if you look closely at the debian testing images i've been pushing, the ip
address is listed on the serial console above the login prompt.. However
with systemd, it boots to fast, so eth0 is usually never updated (it's a
race between getting ip and the init script that updates /etc/issue).

Otherwise give each board a unique host name.. then user can just "ssh


For what it is worth, I get the IP address that is seen from the web by curl

If they have a serial port access they can simply type “ifconfig”.

Failing that, I use the table in my router to determine the ip address.

You would have to turn on one Bone at a time however L


Use port scanning software

Morse code on usrX led's..

Thanks for all the ideas. This is the direction I plan on going now that I’ve made it work.

As a side note, if you are trying this, make sure you have your VM in Bridges mode and not NAT mode. NAT will not work, but it works fine once you go into bridged mode. I just about strangled myself after I messed with it for a few hours thinking I had something really wrong with my hosts files only to change this and have it work.

Last night I set up a VM (Ubuntu 12.04 with Virtual Box) and was able to plug my BBB in via USB, have the VM take control of the USB and then ssh and talk to the beagle.

This seems like the easiest way to set up the beagles.