summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2018-03-07 15:02:25 +0100
committerJonathan Bauer2018-03-07 15:02:25 +0100
commit6fa6419b5dc467a332b80e4aac709aa9cc889ad4 (patch)
tree636a852b89dd7bd90b5b5f8ba0a4d405a42b471d
parent[ib-conf] if VLAN is configured, use the ip of the vlan interface to (diff)
downloadsystemd-init-6fa6419b5dc467a332b80e4aac709aa9cc889ad4.tar.gz
systemd-init-6fa6419b5dc467a332b80e4aac709aa9cc889ad4.tar.xz
systemd-init-6fa6419b5dc467a332b80e4aac709aa9cc889ad4.zip
[systemd-networkd-ext] strengthen vlan matching
-rw-r--r--builder/modules.d/systemd-networkd-ext/hooks/parse-kcl-for-networkd.sh13
1 files changed, 6 insertions, 7 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 4c2d647a..84f8ce7f 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
@@ -105,12 +105,9 @@ generate_networkd_config() {
local BOOTIF_NETWORK_CONF="/etc/systemd/network/${BOOTIF_NAME}.network"
(
echo '[Match]'
- # Use BOOTIF_NAME in bridged since the bridge will have the same MAC
- if [ -n "${BRIDGED}" ]; then
- echo "Name=${BOOTIF_NAME}"
- else
- echo "MACAddress=${BOOTIF}"
- fi
+ echo "MACAddress=${BOOTIF}"
+ echo 'Driver=*'
+ echo ''
# Currently the boot interface is configured to either:
# * static ip as given by the initial DHCP during PXE
# * bridged
@@ -127,13 +124,14 @@ generate_networkd_config() {
else
echo "DHCP=ipv4"
fi
- ) > "${BOOTIF_NETWORK_CONF}"
+ ) > "${BOOTIF_NETWORK_CONF}"
if [ -n "$VLAN" ]; then
local VLAN_DEV_CONF="/etc/systemd/network/${BOOTIF_NAME}.${VLAN}.netdev"
cat <<- EOF > "${VLAN_DEV_CONF}"
[NetDev]
Name=${BOOTIF_NAME}.${VLAN}
+ MACAddress=${BOOTIF}
Kind=vlan
[VLAN]
@@ -145,6 +143,7 @@ generate_networkd_config() {
cat <<- EOF > "${VLAN_NETWORK_CONF}"
[Match]
Name=${BOOTIF_NAME}.${VLAN}
+ Type=vlan
[Link]
MACAddress=${BOOTIF}