-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare switch from legacy network interfaces to systemd-networkd #110
base: master
Are you sure you want to change the base?
Conversation
@mika Currently systemd-networkd is not enabled on the target system. Should we enable it by default (at least for Debian/stretch+ releases)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :)
elif [ -n "$USE_DEFAULT_INTERFACES" ] ; then | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. The info line could be improved to reflect the current behavior.
grml-debootstrap
Outdated
else | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message should mention that we don't support taking over the /e/n/i file from the host at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for your feedback. Further changes incoming.
elif [ -n "$USE_DEFAULT_INTERFACES" ] ; then | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. The info line could be improved to reflect the current behavior.
grml-debootstrap
Outdated
else | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.
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.