Skip to main content
Version: BSP 6.x.y

Ethernet/Network (Linux)


This article provides instructions on how to use utilities for network configuration provided in the Toradex BSP reference images. It contains information on how to use connman and/or systemd-networkd, or how to replace connman with NetworkManager using Yocto.

Yocto BSP Reference Images​

The Toradex BSP reference images currently provide two utilities for network configuration: connman and systemd-networkd. By default, the Ethernet port is managed by connman, and the USB RNDIS interface by systemd-networkd. Depending on the application, it might make sense to use one of those utilities over the other.

By default, connman will try to configure any available network interfaces and tries to keep only (the best) connection connected at any time. The design is targeted toward interactive, wireless devices such as tablets, etc. The systemd-provided utility systemd-networkd, on the other hand, emphasizes headless server systems with static configuration.

Torizon OS​

Torizon OS uses NetworkManager. Even though this article has some information about it, it's meant for people using the Yocto BSP reference images, not people using Torizon OS. If you are using Torizon OS, go directly to Networking with Torizon OS.


Our latest V2.x images use connman as the overall connection management framework. The GUI management tool can be started with connman-properties or by starting the taskbar applet connman-applet.

The command-line interface tool connmanctl can be used in an interactive shell mode or as a single command using arguments.

# connmanctl services
*AO Wired { ethernet_00142d269dfd_cable }

# connmanctl services ethernet_00142d269dfd_cable
[ ethernet_00142d269dfd_cable ]

Type = ethernet
Security = [ ]
State = online
Favorite = True
Immutable = False
AutoConnect = True
Name = Wired
Ethernet = { Method=auto Interface=enp7s0 Address=00:14:2D:26:9D:FD MTU=1500 }
IPv4 = { Method=dhcp Address= Netmask= Gateway= }
IPv4.Configuration = { Method=dhcp }
IPv6 = { }
IPv6.Configuration = { Method=auto Privacy=disabled }
Nameservers = [ ]
Nameservers.Configuration = [ ]
Timeservers = [ ]
Timeservers.Configuration = [ ]
Domains = [ ]
Domains.Configuration = [ ]
Proxy = { URL= Method=auto }
Proxy.Configuration = { }
Provider = { }

Using the interactive mode to configure a static Ethernet address:

# connmanctl
connmanctl> config ethernet_00142d259a48_cable --ipv4 manual
connmanctl> exit

Using the interactive mode to configure the nameservers (DNS):

# connmanctl config ethernet_00142d259a48_cable --nameservers

Using the interactive mode to get an IP automatically via DHCP:

# connmanctl
connmanctl> config ethernet_00142d259a48_cable --ipv4 dhcp
connmanctl> exit


ConnMan can be used for tethering which allows sharing a connection of a device for another locally connected device. The Toradex module running ConnMan would be the device sharing the connection.

Tethering puts some requirements on the kernel. The README in the ConnMan source tree holds more information on these requirements.

USB gadget tethering​


Since image V2.4 systemd-networkd has control over the USB gadget Ethernet interface (RNDIS). Remove the file under /etc/systemd/networkd and make sure usb/rndis is not part of NetworkInterfaceBlacklist in /etc/connman/main.conf.

To enable tethering on the USB gadget interface make sure the USB gadget driver is loaded/enabled first (see USB Device Mode (Linux)). Then ConnMan can be used to enable tethering mode:

# connmanctl 
connmanctl> tether gadget on
connmanctl> [ 194.725436] device usb0 entered promiscuous mode
[ 194.737525] tether: port 1(usb0) entered forwarding state
[ 194.743077] tether: port 1(usb0) entered forwarding state
Enabled tethering for gadget

To preconfigure ConnMan to automatically start Gadget interfaces upon start-up two configuration files are needed:

The main.conf under /etc/connman/main.conf


The service settings file under /var/lib/connman/settings




For other configuration options, the Python interface documentation has some useful configuration examples:

Multiple active connections​

By default, ConnMan is configured to only have one connected technology. This means it will connect only to one interface after boot, even if there are multiple available and configured to auto-connect. But sometimes one wants to have two or more interfaces to be auto connected, e.g. ethernet and WiFi. To achieve this, one can change the ConnMan configuration file at /etc/connman/main.conf, e.g. to enable auto-connect for both ethernet and WiFi, change the following entries accordingly in the configuration file:


Check the man-page of the ConnMan configuration file for more details.


If you want to use NetworkManager, remove connman and add NetworkManager on a custom OpenEmbedded build. See an example below:

# Remove connman
IMAGE_INSTALL:remove = " connman"
IMAGE_INSTALL:remove = " connman-client"
IMAGE_INSTALL:remove = " connman-gnome"
IMAGE_INSTALL:remove = " connman-plugin-wifi"
IMAGE_INSTALL:remove = " connman-plugin-ethernet"
IMAGE_INSTALL:remove = " connman-plugin-loopback"
# Add NetworkManager
IMAGE_INSTALL:append = " networkmanager"
IMAGE_INSTALL:append = " modemmanager"

Check out the OpenEmbedded (core) article to learn how to build and customize a sample Linux image with OpenEmbedded.


If you plan to use systemd-networkd as the primary network configuration utility, you should remove connman first (when using a console-only image, you won't need to remove connman-gnome). You can use the package manager to remove the package from pre-built images by invoking

# opkg remove connman-gnome connman

To remove connman when building an image using OpenEmbedded remove CONMANPKGS from IMAGE_INSTALL in the image recipe recipes/images/ in the meta-toradex layer (see OpenEmbedded (core) how to build a complete image).

Manual Configuration for Wired Connections​


If you are using Torizon OS, go directly to Networking with Torizon OS - Static Network Configuration.

Create a file named '' under /etc/systemd/network/

# vi /etc/systemd/network/

For dynamic IP connection fill in the file with the following content:



For static IP connection:




Using systemd-networkd one can easily setup a network bridge between two Ethernet interfaces:





This example configures a dynamic IP configuration on the ethernet device (untagged) and also creates a new Ethernet interface associated with VLAN 100 (tagged). The example uses a dynamic IP configuration on VLAN 100 too.





Integrating Network Files Into an OpenEmbedded/Yocto Image​

The integration should be done similarly to the existing file, see bbappend and files subdirectory of our systemd configuration:

Place the above file '' inside systemd folder at your oe-core layer directory (at ${LAYERDIR}/meta-toradex/recipes-core/systemd) and edit the bbappend file adding the '' file like bellow:

FILESEXTRAPATHS:prepend := "${THISDIR}/systemd:"

SRC_URI += " \
file:// \
file:// \
file:// \

PACKAGECONFIG:append = " networkd"

do_install:append() {
# The network files need to be in /usr/lib/systemd, not ${systemd_unitdir}...
install -d ${D}${prefix}/lib/systemd/network/
install -d ${D}/etc/systemd/network/
install -m 0644 ${WORKDIR}/ ${D}${prefix}/lib/systemd/network/
install -m 0644 ${WORKDIR}/ ${D}/etc/systemd/network/

FILES_${PN} += " \
${nonarch_base_libdir}/systemd/network \

Manual Network Configuration​

For testing and debugging purposes, you can use iproute2 utilities to manually set up a static IP and BusyBox's udhcpc utility to explicitly request an IP address using DHCP.


This configuration will not be persistent across reboots.

Make sure to disable the networking management daemons to avoid interference:

# systemctl stop connman.service
# systemctl stop systemd-networkd.socket
# systemctl stop systemd-networkd.service

Get a list of interfaces using ip link:

# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,DYNAMIC> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether 00:14:2d:59:ca:81 brd ff:ff:ff:ff:ff:ff
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default
link/sit brd
4: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10

For the BSP, Ethernet interfaces are named eth<x>, which <x> represents the number of the interface, as we can see in the example above.


For Torizon OS the ethernet interfaces are named ethernet<x>. To read more about the Torizon standard, refer to Networking with Torizon OS

Static Network Configuration​

Enable the network interface (e.g. eth0):

# ip link set <interface> up

Assign a static IP address:

# ip addr add <IP_address>/<subnet_mask> broadcast <broadcast_address> dev <interface>

Then add your gateway IP address:

# ip route add default via <default_gateway>

For example:

# ip link set eth0 up
# ip addr add broadcast dev eth0
# ip route add default via

To undo these configurations (e.g. before switching to a dynamic IP), first remove any assigned IP address:

# ip addr flush dev <interface>

Then remove any assigned gateway:

# ip route flush dev <interface>

And finally disable the interface:

# ip link set <interface> down

Dynamic Network Configuration​

The utility udhcpc can be used to get a one time lease for an IP address from the DHCP server serving the local network:

# udhcpc -i eth0
udhcpc (v1.23.2) started
Sending discover...
Sending select for
Lease of obtained, lease time 86400

Ethernet/Network interfaces​

Second Ethernet ports​

For information on using the second Ethernet port some SoMs provide, check the Network on Toradex Computer on Modules article.

Ethernet Benchmark (iperf3)​

Details about Ethernet benchmarking on SoMs are described in the Network on Toradex Computer on Modules article.

Send Feedback!