Bug 13057

Summary: No default network configuration for systemd-networkd
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: coreAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: alessioigorbogani, jku, kai.kang, meta.mr.watcher, meta.watcher, randy.macleod
Version: 5.99   
Target Milestone: 2.8 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)
Bug Depends on:    
Bug Blocks: 13031    

Description Paul Eggleton 2018-12-03 20:00:33 UTC
If you enable systemd (and disable sysvinit) and build an image, e.g. core-image-minimal, the image will currently boot up without enabling any network interfaces. This is because by default we do not seem to deploy a network configuration file under /etc/systemd/network - once I added one there with the appropriate content the network interface got brought up as expected.

Of course the most basic fix would be to write a network config file that just enables DHCP on en*, and let users extend it via a bbappend for anything more complicated. There's a reasonably good guide to this config here:

  https://wiki.archlinux.org/index.php/systemd-networkd

However, we should probably take this opportunity to take a closer look at how all of this fits together. We'd want to consider what happens when connman (or init-ifupdown) is installed, if anything. Also, would putting a config file under /etc go against any long-term stateless goals (assuming that is a goal)?
Comment 1 Jussi Kukkonen 2019-04-03 07:58:34 UTC
There's a system config location (/usr/lib/systemd/network/ maybe?) so installing things to /etc is not necessary.
Comment 2 Kai Kang 2019-05-20 07:14:02 UTC
For init-ifupdown, it provides init script /etc/init.d/networking which calls ifup -a to enable network interfaces. And in configure file /etc/network/interfaces, it has set:

auto eth0                                                                                                                                         
iface eth0 inet dhcp                                                                                                                              
iface eth1 inet dhcp 

Then udhcpc is launched to configure the network interfaces.


For connman, it provides built-in dhcp supports. In README of connman source codes,

The following features are built-in into Connection Manager:
    - IPv4, IPv4-LL (link-local) and DHCP
    - IPv6, DHCPv6 and 6to4 tunnels