are there any way to change the default connman behavior from dhcp to fixed IP (192.168.0.1) from Yocto at image creation time?
I know that the IP can be changed at first access, but I want to set it before in order to access for the first time at a fixed address and then change the settings with a tool like webmin.
Connman is targeted towards mobile network management. It’s strength is in dynamic network configurations, and making use of various (wired and wireless) network technologies.
While it is possible to use connman to configure a static IP address for an ethernet network device, it is not really suited for that use case. I recommend to use systemd-networkd, which is part of our BSP too.
systemd-networkd allows to use a simple configuration files. We already make use of networkd to configure the USB RNDIS network interface. You can add another configuration file inside /etc/systemd/network/ (e.g. called wired.network)…
Thank you for your answer Stefan, it works well for the static IP address.
Now I am looking for a (maybe web based) solution that can be used to configure the network interfaces. Webmin doesn’t work well in angstrom, and other web panels that I found are for large server management…
Have you tried some tools for this task?
Any suggestion will be appreciated…
@stefan.agner I am trying to use init-ifupdown instead of systemd-networkd because init-ifupdown use /etc/network/interfaces and this will enable the webmin network configuration module.
The problem is that systemd seems to not call /etc/init.d/network at boot, AFAIK systemd should call sysv scripts… Have you ever tested this scenario? May I create a systemd service script in order to let /etc/init.d/network start?
@stefan.agner yes, I forgot to mention that I intend to use init-ifupdown.
My tests show that if I remove /etc/systemd/system/networking.service the /etc/init.d/networking script is called and used to manage the network part.
So I want to create a sort of do_mkrmscript in my image recipe in order to remove that file, but unfortunately I haven’t understand how and when you run the ${WORKDIR}/rmscript in your image… Do you launch it via IMAGE_PREPROCESS_COMMAND ?
Yeah that file actually is a systemd mask file, which means that it disables the networking.service:
root@colibri-vf:~# ls -la /etc/systemd/system/networking.service
lrwxrwxrwx 1 root root 9 Dec 16 2015 /etc/systemd/system/networking.service -> /dev/null
It seems that the package systemd-compat-units is responsible for that. The package disables various systemd compatibility services (see SYSTEMD_DISABLED_SYSV_SERVICES). To test, you can remove the networking from that list. The proper way would be to overwrite that variable using a bbappend in your layer.
I came across this issue today, looking for how to set a static IP address in a bootimage for Colibri iMX6. I understand that a configuration file in /etc/systemd/network/ might be a possibility to achieve that.
However, I’d like to keep connman in my bootimage because I’ve already spent quite some effort to migrate existing implementations for user-controllable IP configuration so that they use connman if running on Colibri iMX6.
So my question is: What is an appropriate, connman-compatible way to set a static IP address/netmask/gateway in a Colibri iMX6 bootimage? It shall be possible to modify the network settings or to switch to DHCP by calls of “connmanctl config …” later on.
So my question is: What is an appropriate, connman-compatible way to set a static IP address/netmask/gateway in a Colibri iMX6 bootimage? It shall be possible to modify the network settings or to switch to DHCP by calls of “connmanctl config …” later on.
You can keep Connman in the Image, but just disable it for testing purposes, as described here.