summaryrefslogtreecommitdiffstats
path: root/builder/modules.d/systemd-networkd-ext/hooks/parse-kcl-for-networkd.sh
diff options
context:
space:
mode:
authorJonathan Bauer2019-06-17 17:37:02 +0200
committerJonathan Bauer2019-06-17 17:37:02 +0200
commita079118f0877886bd1c838778c26c410675b0b51 (patch)
tree203f5803b2034b0113eafa141a996d7ac24a8757 /builder/modules.d/systemd-networkd-ext/hooks/parse-kcl-for-networkd.sh
parent[slx-uuid] save uuid under /etc in stage4 (diff)
downloadsystemd-init-a079118f0877886bd1c838778c26c410675b0b51.tar.gz
systemd-init-a079118f0877886bd1c838778c26c410675b0b51.tar.xz
systemd-init-a079118f0877886bd1c838778c26c410675b0b51.zip
[systemd-networkd-ext] add missing 'Path=pci*' to
stage4 dhcp config. Also add DHCP options on VLAN network config
Diffstat (limited to 'builder/modules.d/systemd-networkd-ext/hooks/parse-kcl-for-networkd.sh')
-rw-r--r--builder/modules.d/systemd-networkd-ext/hooks/parse-kcl-for-networkd.sh34
1 files changed, 29 insertions, 5 deletions
diff --git a/builder/modules.d/systemd-networkd-ext/hooks/parse-kcl-for-networkd.sh b/builder/modules.d/systemd-networkd-ext/hooks/parse-kcl-for-networkd.sh
index 707557c4..cf61be3c 100644
--- a/builder/modules.d/systemd-networkd-ext/hooks/parse-kcl-for-networkd.sh
+++ b/builder/modules.d/systemd-networkd-ext/hooks/parse-kcl-for-networkd.sh
@@ -98,6 +98,23 @@ create_udev_bootif_name_rule() {
echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="'${BOOTIF}'", NAME="'${BOOTIF_NAME}'"' > /etc/udev/rules.d/70-pxe-boot-interface.rules
}
+disable_ipv6() {
+ cat <<- EOF
+ LinkLocalAddressing=no
+ IPv6AcceptRA=no
+ EOF
+}
+
+dhcp_options() {
+ cat <<- EOF
+ [DHCP]
+ UseDNS=true
+ UseDomains=true
+ UseHostname=true
+ CriticalConnection=true
+ EOF
+}
+
## Generate network and link file(s) for networkd
# Checks if an IP configuration was forwarded by
generate_networkd_config() {
@@ -115,6 +132,7 @@ generate_networkd_config() {
# In particular, configuring both vlan tags and the physical
# interface is not supported (might be needed in some setups)
echo '[Network]'
+ disable_ipv6
if [ -n "${BRIDGED}" ]; then
echo "Bridge=${BRIDGE_NAME}"
elif [ -n "${CLIENT_IP}" -a -n "${GATEWAY_IP}" ]; then
@@ -122,9 +140,9 @@ generate_networkd_config() {
elif [ -n "${VLAN}" ]; then
echo "VLAN=$BOOTIF_NAME.$VLAN"
else
- echo "DHCP=ipv4"
+ echo -e "DHCP=ipv4\n"
+ dhcp_options
fi
- echo "LinkLocalAddressing=no"
) > "${BOOTIF_NETWORK_CONF}"
if [ -n "$VLAN" ]; then
@@ -151,8 +169,12 @@ generate_networkd_config() {
[Network]
DHCP=ipv4
- LinkLocalAddressing=no
EOF
+ (
+ disable_ipv6
+ echo ""
+ dhcp_options
+ ) >> "${VLAN_NETWORK_CONF}"
fi
# bridge setup
@@ -171,17 +193,19 @@ generate_networkd_config() {
echo "Name=${BRIDGE_NAME}"
echo ""
echo '[Network]'
+ disable_ipv6
if [ -n "${CLIENT_IP}" -a -n "${GATEWAY_IP}" ]; then
print_static_ip_conf "${CLIENT_IP}/${CIDR:-24}" "${GATEWAY_IP}"
else
# bad/no IP info, fallback to DHCP
- echo "DHCP=ipv4"
+ echo -e "DHCP=ipv4\n"
+ dhcp_options
fi
- echo "LinkLocalAddressing=no"
) > "${BRIDGE_NETWORK_CONF}"
fi
return 0
}
+
# from parse-ip-opts.sh
# Takes a netmask and outputs the corresponding CIDR
# e.g.