Preconfigure static IP address with connmanctl on Beaglebone Black
Have you tried using a provisioning file?
Here is a minimal example for /var/lib/connman/default.config
:
[service_eth0]
Type = ethernet
IPv4 = 10.0.10.0/255.255.0.0
Connman should use this configuration, if there's none available in /var/lib/connman/ethernet*
.
You can find more details and examples in the connman manpages, e.g. https://www.mankier.com/5/connman-service.config
Related videos on Youtube
igal
BY DAY: Python, Linux and Mac OS. Getting all my ducks in one basket. BY NIGHT: Sleeping. Dead as a cucumber. FOR FUN: Beer and Netflix. Taking nothing for granite. "All roads lead to moss."
Updated on September 18, 2022Comments
-
igal over 1 year
Short Version
How can I used
connmanctl
to set a static IP address for an Ethernet interface on a Beaglebone Black running Debian 9 - prior to connecting the device to an Ethernet cable?Longer Version
I'm trying to set a static IP address for an Ethernet interface (eth0) on a Beaglebone Black running Debian 9. I've found instructions online that seem to be working, e.g.:
They suggest the following steps:
Connect a working Ethernet cable to a LAN port
-
Get the ConnMan service name, e.g.:
user@host:~$ connmanctl services *AO Wired ethernet_6ceceb5cc3e2_cable
-
Set the static IP through ConnMan, e.g.:
user@host:~$ sudo connmanctl config ethernet_6ceceb5cc3e2_cable --ipv4 manual 10.0.10.0 255.255.0.0
The problem for me is that I would like to configure the device before it's connected to a network via Ethernet. But the
connmanctl services
command doesn't produce any output until I do. -
Jędrzej Dudkiewicz about 4 yearsWhat if I have two interface, eth0 and eth1? Can I configure them somehow? It seems that "eth0" in "service_eth0" is meaningless and serves only as unique identifier of service. To be honest connman seems to be incredibly poorly documented - there are manpages and all, but it seems that basically what I can do with it (using commandline) is configure eduroam, and if I want static IPs on multiple interfaces I should blacklist them and configure using /etc/network/interfaces - this seems suboptimal to say the least.