I'm using multiple BBB's (Rev C), communicating with them from my Mac (OSX 10.9.3) over USB using the HoRNDIS drivers. The BBB's are running Debian, and so I want to manually assign them all different static IP's. However, I can't get the IP to be anything but Changing the /etc/network/interfaces file to have an ip of does nothing:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp
# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE

auto eth0
iface eth0 inet static

# WiFi Example
#auto wlan0
#iface wlan0 inet dhcp
#    wpa-ssid "essid"
#    wpa-psk  "password"

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
# Note on some boards, usb0 is automaticly setup with an init script
# in that case, to completely disable remove file [run_boot-scripts] from the boot partition
iface usb0 inet static

Indeed, there was a file in the boot partition that I also changed, with no result:


# Update /etc/network/interfaces to add virtual Ethernet port
cat >>/etc/network/interfaces <<EOF

iface usb0 inet static

# Add terminal to virtual serial port
cat >/etc/init/gadget-serial.conf <<EOF
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

exec /sbin/getty 115200 ttyGS0

# Write script to start gadget driver
cat >/usr/sbin/g-multi-load.sh <<'EOF'
if [ "`lsmod | grep g_multi`" != "" ]; then exit 0; fi

DEV_ADDR=$(perl -e 'print join(":",unpack("(H2)*",<>))' ${mac_addr})
VERSION=$(perl -e '@x=unpack("A12A4",<>); print $x[1]' ${eeprom})
SERIAL_NUMBER=$(perl -e '@x=unpack("A16A12",<>); print $x[1]' ${eeprom})
ISBLACK=$(perl -e '@x=unpack("A20A4",<>); print $x[1]' ${eeprom})

if [ "${ISBLACK}" = "BBBK" ] ; then
if [ "${ISBLACK}" = "BNLT" ] ; then

modprobe g_multi file=/dev/mmcblk0p1 cdrom=0 stall=0 removable=1 nofua=1 iSerialNumber=${SERIAL_NUMBER} iManufacturer=Circuitco iProduct=BeagleBone${BLACK} host_addr=${DEV_ADDR}

# Enable the network interface
sleep 1
ifup usb0
chmod +x /usr/sbin/g-multi-load.sh

# Add script to rc.local
perl -i -pe 's!^exit 0!/usr/sbin/g-multi-load.sh\nexit 0!' /etc/rc.local

# Install DHCP server
sudo apt-get -y update
sudo apt-get -y install isc-dhcp-server

# Configure DHCP server
cat >/etc/ltsp/dhcp.conf <<EOF
ddns-update-style none;
subnet netmask {
perl -i -pe 's/INTERFACES=".*"/INTERFACES="usb0"/' /etc/default/isc-dhcp-server

# Start up services
service isc-dhcp-server start

There is a 3rd file you need to change for BeagleBone Black: /opt/scripts/boot/am335x_evm.sh

I found it here: http://ewong.me/changing-usb0-ip-address-on-the-beaglebone-black

  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference.  Link-only answers can become invalid if the linked page changes.  For example, edit your answer to describe the /opt/scripts/boot/am335x_evm.sh file and the changes that need to be made. – G-Man Apr 8 '15 at 0:37
  • Indeed this is now the case. Link is dead. – sherrellbc Dec 12 '16 at 16:33

I tried this on my BBB and it didn't work. It turned out that the network configuration on my Beaglebone was being controlled by connman. Editing /etc/network/interfaces and other script files had no effect after a reboot. (I suppose if I had used the GUI interface, this may have been more obvious. As it was, I spun my wheels for hours trying to figure out what was going on...) I finally got it to permanently change to a static ip configuration by entering the following commands:

First, you need to find the "service name" for your (in my case, wired) connection. Enter:

connmanctl services

In my case, my wired connection was called "ethernet_b0d5cc8194db_cable". You need this to set the configuration for the connection. The following set my eth0 (wired) connection to the static ip address "":

connmanctl config ethernet_b0d5cc8194db_cable ipv4 manual

To add a nameserver:

connmanctl config ethernet_b0d5cc8194db_cable --nameservers

I also was able to disable ipv6 (just my preference):

connmanctl config ethernet_b0d5cc8194db_cable ipv6 off

It's a shame that we are coming up with so many different ways to configure the network on linux!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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