Set static IP address for Beaglebone black

I am doing yocto project (kirkstone) on Beaglebone Black Board using meta-ti layer. How to set static IP address for eth0 in BBB.
These are the contents of my /etc/network/interfaces file.

root@beaglebone:/etc/network# cat interfaces
#/etc/network/interfaces – configuration file for ifup(8), ifdown(8)

#The loopback interface
auto lo
iface lo inet loopback

#Wireless interfaces
iface wlan0 inet dhcp
wireless_mode managed
wireless_essid any
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf

iface atml0 inet dhcp

#Wired or wireless interfaces
auto eth0
iface eth0 inet dhcp
iface eth1 inet dhcp

#Ethernet/RNDIS gadget (g_ether)
#…or on host side, usbnet and random hwaddr
iface usb0 inet static

#Bluetooth networking
iface bnep0 inet dhcp

On the target


Let see what that build has installed for networking. Also, you might have to add pstree into your local.conf

Thank you for your reply. I add pstree into my local.conf. it is show like this.

root@beaglebone:~# pstree

What is the static IP you are planning to use?

On the target:

$ip addr show

How are you connecting this to the network?

Unless you have a specific reason for you using the yocto build, the best solution for this to get you up and running would be the use the IoT image for the bbb.

These images are running systemd. If memory is correct about the only thing you might need to add to those images might be gdb and cmake. This image has cockpit installed, you will like that.

I connected an ethernet cable to my BBB.
The ip addr show gave the following output.

root@beaglebone:~# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
    link/ether 64:8c:bb:f7:74:15 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::668c:bbff:fef7:7415/64 scope link
       valid_lft forever preferred_lft forever

Next I connected from a PC to BBB using an ethernet cable. The output is

root@beaglebone:~# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
    link/ether 64:8c:bb:f7:74:15 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::668c:bbff:fef7:7415/64 scope link
       valid_lft forever preferred_lft forever

Actually I need yocto project for my linux based HMI which launches a Qt application on boot. I also want to communicate to other boards through RS485, ethernet and USB from my HMI.

On your host (PC) set your IP to a static address on the same subnet as your BBB.

This is much easier to do if you are running debian or ubuntu. On windows you will have to go several layers deep.

eth0 is working fine and this can be seen from the IP that was assigned by your DHCP server.

I set a static ip address in my linux PC. I gave values for address, subnet and gateway. After that I connected an ethernet cable from PC ethernet port to BBB ethernet port.
I haven’t made any changes in the BBB side. When I checked ifconfig, I got some random IP address. Each time I reboot this address will change.

I run this /etc/init.d/networking restart in my BBB.
It gave me the following error.

[   74.164290] cpsw-switch 4a100000.switch: starting ndev. mode: dual_mac
[   74.189893] cpsw-switch 4a100000.switch: phy "/ocp/interconnect@4a000000/segment@0/target-module@100000/switch@0/mdio@1000/ethernet-phy@0" not found on slave 0

I don’t have anything running connman so I cannot work along with you.

Did check the bing chat bot regarding the connman config.

If you use an exit node from EU instead of USA you will get better information. They are playing games with content delivered to USA endpoints.

You should be able to set static ip per the bing instructions and ping each device.
At this point without having a parallel setup it is hard to troubleshoot.

Bing chat bot:

Certainly! If you’re using ConnMan to manage network connections on your Linux system and want to set a static IP address, here are the steps you can follow:

Identify the Service Name: First, you need to find the service name associated with the network interface you want to configure. You can do this by running the following command:

connmanctl services

Look for the service name corresponding to the network interface (e.g., ethernet_6ceceb5cc3e2_cable or wifi_<HASH>_managed_psk).

Set the Static IP Address: Once you have the service name, use the following command to set a static IP address (replace <service_name> with the actual service name and adjust the IP address, subnet mask, and gateway as needed):

sudo connmanctl config <service_name> --ipv4 manual

For example, if your service name is ethernet_6ceceb5cc3e2_cable, the command would be:

sudo connmanctl config ethernet_6ceceb5cc3e2_cable --ipv4 manual

Verify the Configuration: To verify that the static IP address has been set, you can check the configuration file associated with the service. For Wi-Fi networks, the configuration file is located at /var/lib/connman/wifi_<HASH>_managed_psk/settings. You can manually create or edit this file with the desired settings. Here’s an example of the content:


Replace <SSID> with the network name, <PASS> with the Wi-Fi password, and adjust the IP address as needed.

Remember to replace placeholders like <service_name>, , , and with actual values relevant to your network configuration. If you encounter any issues, refer to the man page for connman-service.config1. Additionally, if you’re configuring Wi-Fi, ensure that the desired IP address is not conflicting with other devices on the network. :globe_with_meridians::wrench:

seem yocto does not install connmanctl, at least with my build
looked at network manager, didn’t seem to work for me either.

You will not get a good image using the ti recipe.
I used good old poky, added the ti layers and my own meta layer. Yocto just takes us so much space i had to delete so much of the stuff done for the BBB to make room for the i7 builds.

The IoT BBB image works just fine and is much simpler the use. Doing a proof of concept with a BBB in the system and regret deleting our previous work…

The yocto image in the yocto example for the BBB works perfectly. If memory is correct networking is up, out of the box with that one.

This is a local.conf we used to get the weston compositor up on bbb. Pretty sure if you just delete the opengl wayland and pam, then repoint the ss-cache and download directory you should get a good image.

MACHINE ?= "beaglebone-yocto"

DL_DIR ?= "/home/fred/build-files/downloads"

SSTATE_DIR ?= "/home/fred/build-files/ss-cache-armhf"

DISTRO ?= "poky"

PACKAGE_CLASSES ?= "package_deb"

INIT_MANAGER = "systemd"
EXTRA_IMAGE_FEATURES ?= " debug-tweaks tools-debug tools-testapps tools-sdk dbg-pkgs dev-pkgs"

USER_CLASSES ?= "buildstats"
DISTRO_FEATURES ?= "opengl wayland pam"


    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    HALT,${TMPDIR},100M,1K \
    HALT,${DL_DIR},100M,1K \
    HALT,${SSTATE_DIR},100M,1K \


Here is the layer.conf for that build. I cannot 
post the custom layer so just delete that.


# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly


  /home/fred/core-builds/poky/meta \
  /home/fred/core-builds/poky/meta-poky \
  /home/fred/core-builds/poky/meta-yocto-bsp \
  /home/fred/meta-layers/meta-arm/meta-arm-toolchain \
  /home/fred/meta-layers/meta-arm/meta-arm \
  /home/fred/meta-layers/meta-arm/meta-arm-bsp \
  /home/fred/meta-layers/meta-basic-weston-dev \
  /home/fred/meta-layers/meta-openembedded/meta-oe \
  /home/fred/meta-layers/meta-wayland \

Here is another one, just pull the line with x11 and remove gtk* and this should also work fine. It might be an SD only due to the other stuff.

MACHINE ?= "beaglebone-yocto"
DISTRO ?= 'poky'
PACKAGE_CLASSES ?= 'package_deb'
EXTRA_IMAGE_FEATURES ?= "debug-tweaks \
						tools-debug \
						tools-testapps \
						tools-sdk \
						dbg-pkgs \
						eclipse-debug \
						tools-profile \
PACKAGE_EXCLUDE = "packagegroup-core-ssh-dropbear"
IMAGE_INSTALL:append = " python3 \
	rsync \
	pstree \
	cmake \
	gdb \
	gcc \
	sudo \
	git \
	python3-pip \
	acl \
	openssh \
	nano \
	make \
	xz \
	gzip \
	tree \
	pstree \
	nmap \
	sqlite3 \
	cunit \
	libgpiod \
	libusb1 \
	gtk+3 \
	gtk4 \
	findutils "

USER_CLASSES ?= "buildstats"
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    HALT,${TMPDIR},100M,1K \
    HALT,${DL_DIR},100M,1K \
    HALT,${SSTATE_DIR},100M,1K \
PACKAGECONFIG:append:pn-qemu-system-native = " sdl"

DL_DIR ?= "/home/fred/code/downloads/"
SSTATE_DIR ?= "/home/fred/code/sstate-cache"

#Enable buildhistory
INHERIT += "buildhistory"
BUILDHISTORY_DIR ?= "${TOPDIR}/buildhistory"
1 Like

Actually I am using MACHINE = 'beaglebone' of the meta-ti layer for my yocto build.

I run this command to check connman and got this result:

$ connmanctl services
sh: connmanctl: command not found

I added connman to my local.conf file and still got the same result.

I run some commands in my yocto linux.

root@beaglebone:~# service --status-all
 [ - ]
 [ - ]  alsa-state
 [ + ]  apmd
 [ + ]  avahi-daemon
 [ - ]
 [ + ]  bluetooth
 [ - ]  bootlogd
 [ - ]
 [ - ]
 [ ? ]  connman
 [ + ]  dbus-1
 [ - ]
 [ - ]
 [ ? ]  dropbear
 [ - ]
 [ ? ]
 [ - ]
 [ - ]
 [ - ]
 [ ? ]  neard
 [ ? ]  networking
 [ ? ]  ofono

root@beaglebone:~# ps aux | grep -E 'connmand'
root       513  0.0  0.6   9920  3088 ?        Ss   12:34   0:00 /usr/sbin/connmand
root      1249  1.0  0.2   2156  1276 ttyS0    S+   12:40   0:00 grep -E connmand

root@beaglebone:/etc# cd init.d
root@beaglebone:/etc/init.d# ls  rcS			rpcbind      sshd	    tcf-agent	  urandom
alsa-state    bluetooth    connman	     functions    mdmonitor    neard	    ppp		      stop-bootlogd  udev	  xserver-nodm
apmd	      bootlogd	   dbus-1	     halt  networking	          reboot			sendsigs	    umountfs
avahi-daemon  ofono	    rc		    		single	     syslog

Given below is the content of /etc/init.d/connman


DESC="Connection Manager"

if [ -f /etc/default/connman ] ; then
	. /etc/default/connman

set -e


exec 9<&0 < /proc/mounts
while read dev mtpt fstype rest; do
	if test $mtpt = "/" ; then
		case $fstype in
		    nfs | nfs4)

do_start() {
	if test $nfsroot -eq 1 ; then
	    NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'`
	    NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'`

	    if [ ! -z "$NET_ADDR" ]; then
		if [ "$NET_ADDR" = dhcp ]; then
		    ethn=`ifconfig | grep "^eth" | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"`
		    if [ ! -z "$ethn" ]; then
		    for i in $NET_DEVS; do
			ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`
			if [ "$NET_ADDR" = "$ADDR" ]; then
	if [ -f /usr/share/connman/wired-setup ] ; then
		. /usr/share/connman/wired-setup

do_stop() {
	start-stop-daemon --stop --name connmand --quiet

case "$1" in
	echo "Starting $DESC"
	echo "Stopping $DESC"
	echo "Restarting $DESC"
	sleep 1
	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
	exit 1

exit 0

Dump the Ti provided information that is from their website and go to the yocto project. Setup yocto exactly as they say and run it.

"MACHINE =beaglebone-yocto"

That should be in the default local.conf. Don’t touch any thing, then do the initial build as they say and test the qemu. When that checks out modify your local config. Also, since you have a download directory from the previous builds, point your “poky” build to that. Or move the download directory into a common ground location, that will save you hours of downloading. Also set up the sscache, use one sscache for armhf and another for arch64.

Also, if you have NVMe move your yocto stuff onto it.

I don’t believe all the Ti layers are much past the kirkstone release, so if you need to use Ti layers you will have to checkout kirkstone.

1 Like

that’s what i did for a nanbield build, don’t remember all the issue he’s having.
testing kirkstone now, will get back

NetworkManager does not seem to work on kirkstone branch
will look at nanbield branch over the week end. already built, just need to program an sdcard and test.

1 Like

I should have thought about this sooner, if you have multiple ethernet interfaces running such as wire and wifi turn one off, the wifi. You will have instability, it does work on both at the same time just be aware so you can restart or turn one off.

Connect your wire directly between bbb and your host.
Assign your host an IP in the IPv4 tab,

You can use what ever subnet and address you need, just make sure all devices are on same subnet and gateway is .1

If you have wifi leave it alone, just toggle it off and on. Preferable leave it off until you get your wire up.

Ok i will try it. But is there any modification should i make in BBB side?

It should be fine, assuming the interface is configured for static.

At this point the best plan would be to load the IoT image on SD and run it. Get your networking configured with static IP first then go back to the yocto build when you know the proper settings. I know for fact the IoT (12) image (flasher) networking works fine, too many unknowns is too much trouble to deal with at one time.

Using the BB IoT image, set this file like mine. You should see the same interface id. This will allow you to have a static IP then if you need to connect to the internet to download packages or whatever you just connect the ethernet to your local gateway/router.

It is best practice to run your dev network on a subnet that is different than your “main” network with internet access.

fred@bb3:/etc/systemd/network$ cat 



after including systemd
also this build was with beaglebone-yocto, kirkstone branch

networkctl list

sudo systemctl restart systemd-networkd
networkctl status

looking back at my note, it seems like they change the network configuration a lot. LOL

1 Like

The systemd networking is the most reliable way to go.

Dropping dropbear and adding systemd to the yocto build he should be good to go. The other issue might be how the host is configured.