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

systemd-networkd: default to DUIDType=link-layer for ipv6; via networkd.conf.d #7232

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Use LL (link-layer, sans timestamp) DUIDs for DHCP.
# It is the default for v4, but not for v6.
# Having it set to LL allows network admins to do MAC-based reservations for v6 the same way there's done for v4.
# If the MAC address of an interface is 01:02:03:04:05:06, then the DUID will be 00030001010203040506
[DHCPv4]
DUIDType=link-layer

[DHCPv6]
DUIDType=link-layer
9 changes: 8 additions & 1 deletion extensions/network/net-systemd-networkd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,19 @@ function pre_install_kernel_debs__configure_systemd_networkd() {
local netplan_config_src_folder="${EXTENSION_DIR}/config-networkd/netplan/"
local netplan_config_dst_folder="${SDCARD}/etc/netplan/"

run_host_command_logged cp -v "${netplan_config_src_folder}"* "${netplan_config_dst_folder}"

local networkd_config_src_folder="${EXTENSION_DIR}/config-networkd/systemd/network/"
local networkd_config_dst_folder="${SDCARD}/etc/systemd/network/"

run_host_command_logged cp -v "${netplan_config_src_folder}"* "${netplan_config_dst_folder}"
run_host_command_logged cp -v "${networkd_config_src_folder}"* "${networkd_config_dst_folder}"

local networkd_conf_d_config_src_folder="${EXTENSION_DIR}/config-networkd/systemd/networkd.conf.d/"
local networkd_conf_d_config_dst_folder="${SDCARD}/etc/systemd/networkd.conf.d/"

mkdir -p "${networkd_conf_d_config_dst_folder}" # This doesn't exist by default, create it
run_host_command_logged cp -v "${networkd_conf_d_config_src_folder}"* "${networkd_conf_d_config_dst_folder}"

# Change the file permissions according to https://netplan.readthedocs.io/en/stable/security/
chmod -v 600 "${SDCARD}"/etc/netplan/*
}