Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jkirk
Copy link
Contributor

@jkirk jkirk commented Jul 24, 2018

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.

@jkirk jkirk requested a review from mika July 24, 2018 19:02
@jkirk
Copy link
Contributor Author

jkirk commented Jul 25, 2018

@mika Currently systemd-networkd is not enabled on the target system.

Should we enable it by default (at least for Debian/stretch+ releases)?

Copy link
Member

@mika mika left a 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 :)

grml-debootstrap Show resolved Hide resolved
grml-debootstrap Outdated Show resolved Hide resolved
grml-debootstrap Outdated Show resolved Hide resolved
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"
Copy link
Member

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)

Copy link
Contributor Author

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"
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

Copy link
Contributor Author

@jkirk jkirk left a 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"
Copy link
Contributor Author

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 Show resolved Hide resolved
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"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

grml-debootstrap Outdated Show resolved Hide resolved
@jkirk
Copy link
Contributor Author

jkirk commented Jul 25, 2018

@mika: I updated the PR. Please review. Thx.

@jkirk
Copy link
Contributor Author

jkirk commented Jul 25, 2018

@mika; And yes, the next step is to enable systemd-networkd. But I am not sure if this should be part of this PR.

@mika
Copy link
Member

mika commented Aug 9, 2018

Via @zeha and https://twitter.com/CyrilBrulebois/status/1026935974931116032 ->

udevadm info -e | egrep 'ID_NET_NAME_(ONBOARD|PATH)'

is our friend to identify the device name network devices will get assigned, independent of their current naming, JFTR :)

@mika
Copy link
Member

mika commented Oct 15, 2019

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.
@paulmenzel
Copy link
Contributor

@jkirk, it would be awesome if you could rebase this.

@jkirk jkirk self-assigned this Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants