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

Provide command line option(s) to choose between legacy network and systemd-network #105

Open
jkirk opened this issue Jul 28, 2017 · 2 comments
Assignees
Labels

Comments

@jkirk
Copy link
Contributor

jkirk commented Jul 28, 2017

It would be nice to have an option to let grml-debootstrap set up a legacy network or a systemd-network configuration.

This includes but might not be limited to:

  • Enable/disable systemd-networkd and systemd-resolved
  • Provide (legacy / systemd) network configuration or copy configuration from host (not sure how to handle a non-systemd host system)
  • Choose between classic and predictable interface naming scheme
  • Command line option --defaultinterfacenames needs to take into account which network-configuration-option has been chosen

Just for reference, a valid DHCP configuration would look like this (when using the predictable interface names):

# /etc/systemd/network/80-dhcp.network
[Match]
Name=en*

[Network]
DHCP=yes

Proposed command line options:

  • --network-legacy (default?)
  • --network-systemd
  • --network-naming-legacy (default?)
  • --network-naming-predictable
@jkirk
Copy link
Contributor Author

jkirk commented Oct 31, 2017

Because of systemd/systemd#5625 the following configuration should be provided:

# /etc/systemd/network/80-dhcp.network
[Match]
Name=en*

[Network]
#DHCP=yes
DHCP=ipv4
IPv6AcceptRA=no
LinkLocalAddressing=no

@jkirk
Copy link
Contributor Author

jkirk commented Oct 31, 2019

In our todays Grml-Meeting we decided to provide the following options with the following behavior:

  • --nointerfaces: Do not install network configuration files
  • --defaultinterfaces (new default): Install default /etc/network/interfaces or /etc/network/80-dhcp.network (depending on --network <network type>, see below).
  • --hostinterfaces (old default): Copy /etc/network/interfaces or /etc/network/* from host to target (depending on --network <network type>, see below).

Some of the functionality is already provided in PR #110.

New configuration option:

  • --network <network type>: Either 'ifupdown' (default) or 'systemd'. Choose which default network (see --defaultinterfaces) or host network configuration (see --hostinterfaces) should be deployed and which network manager should be enabled. (The other will be disabled.)

The default systemd networkd configuration, which will be deployed if --network systemd is given, should look like this:

# /etc/systemd/network/80-dhcp.network
[Match]
Name=e*

[Network]
DHCP=yes
#DHCP=ipv4
#IPv6AcceptRA=no
#LinkLocalAddressing=no

Note: We match e* because we also want to match eth* and Predictable network interface names of the type Ethernet

The default ifupdown network configuration, which will be deployed if no --network or if the --network ifupdown option is given:

# /etc/network/interfaces - generated by grml-debootstrap

# Include files from /etc/network/interfaces.d when using
# ifupdown v0.7.44 or newer:
#source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug $PREDICTABLE_INTERFACE
iface $PREDICTABLE_INTERFACE inet dhcp

Note: We only provide eth0 and the detected "predicted interface name". Wildcards are not possible in /etc/network/interfaces.

We also decided to not install / copy any examples anymore. Even if /etc/network/interfaces.examples exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant