Prepare switch from legacy network interfaces to systemd-networkd#110
Prepare switch from legacy network interfaces to systemd-networkd#110jkirk wants to merge 4 commits into
Conversation
|
@mika Currently systemd-networkd is not enabled on the target system. Should we enable it by default (at least for Debian/stretch+ releases)? |
mika
left a comment
There was a problem hiding this comment.
If we submit this then networking is still being used with ifupdown, right? We should at least try enabling systemd-networkd by default, and only when encountering problems then let's consider fallback options? /cc @zeha
BTW: Would be great if this PR could also include the preparation of the according debian/NEWS entry and also a networking test with test VM on travis :)
| einfo "Installing default /etc/network/interfaces as requested via --defaultinterfaces options." | ||
| einfo "Installing default /etc/systemd/network/80-dhcp.network as requested via --defaultinterfaces options." | ||
| echo "$DEFAULT_SYSTEMD_NETWORKD" > "${MNTPOINT}/etc/systemd/network/80-dhcp.network" | ||
| echo "$DEFAULT_INTERFACES" > "${MNTPOINT}/etc/network/interfaces" |
There was a problem hiding this comment.
Isn't this wrong? (Now installing the 80-dhcp.network for systemd-network and the /e/n/ for ifupdown)
There was a problem hiding this comment.
Right. The info line could be improved to reflect the current behavior.
| ewarn "Couldn't read /etc/network/interfaces, installing default /etc/network/interfaces" | ||
| einfo "Setting up Virtual Machine, installing default /etc/systemd/network/80-dhcp.network" | ||
| echo "$DEFAULT_SYSTEMD_NETWORKD" > "${MNTPOINT}/etc/systemd/80-dhcp.network" | ||
| echo "$DEFAULT_INTERFACES" > "${MNTPOINT}/etc/network/interfaces" |
There was a problem hiding this comment.
The commit message should mention that we don't support taking over the /e/n/i file from the host at all?
jkirk
left a comment
There was a problem hiding this comment.
Thx for your feedback. Further changes incoming.
| einfo "Installing default /etc/network/interfaces as requested via --defaultinterfaces options." | ||
| einfo "Installing default /etc/systemd/network/80-dhcp.network as requested via --defaultinterfaces options." | ||
| echo "$DEFAULT_SYSTEMD_NETWORKD" > "${MNTPOINT}/etc/systemd/network/80-dhcp.network" | ||
| echo "$DEFAULT_INTERFACES" > "${MNTPOINT}/etc/network/interfaces" |
There was a problem hiding this comment.
Right. The info line could be improved to reflect the current behavior.
| ewarn "Couldn't read /etc/network/interfaces, installing default /etc/network/interfaces" | ||
| einfo "Setting up Virtual Machine, installing default /etc/systemd/network/80-dhcp.network" | ||
| echo "$DEFAULT_SYSTEMD_NETWORKD" > "${MNTPOINT}/etc/systemd/80-dhcp.network" | ||
| echo "$DEFAULT_INTERFACES" > "${MNTPOINT}/etc/network/interfaces" |
58b9a23 to
49f7f58
Compare
|
@mika: I updated the PR. Please review. Thx. |
|
@mika; And yes, the next step is to enable systemd-networkd. But I am not sure if this should be part of this PR. |
|
Via @zeha and https://twitter.com/CyrilBrulebois/status/1026935974931116032 ->
is our friend to identify the device name network devices will get assigned, independent of their current naming, JFTR :) |
|
FTR, I'd like to get this integrated rather sooner than later. :) |
By default grml-debootstrap used the host /etc/network/interfaces file to configure the network of the target system. This might have been ok, when grml-debootrap was primarily run form a Grml live system. But this might expose to much unwanted information about the host system when run without it. If the user really needs to copy any files from the host to the target system, she should use a post-script. While at it we also removed copying the interfaces.examples functionality. If no networking option is given, the --defaultinterfaces option will be the new default. We now provide a systemd-networkd configuration enabling DHCP on all ethernet network devices next to the legacy /etc/network/interfaces which only enables DHCP on eth0 (which does not work when using the predictable devices names). NOTE: systemd-networkd is currently not enabled by default.
The new option --hostinterfaces imitates to old default behavior of grml-debootstrap where the host network configuration was copied from the host to target system. We now default to --defaultinterfaces where /etc/network/interfaces and /etc/network/systemd/80-dhcp.network are installed. The option conflicts with --defaultinterfaces and --nointerfaces.
49f7f58 to
3289386
Compare
|
@jkirk, it would be awesome if you could rebase this. |
By default grml-debootstrap used the host /etc/network/interfaces file
to configure the network of the guest system. We now provide a
systemd-networkd configuration enabling DHCP on all network devices next
to the legacy /etc/network/interfaces which only enables DHCP on eth0
(which does not work when using the predictable devices names).
If no networking option is given, this will be the new default.
NOTE: systemd-networkd is currently not enabled by default.