From 2b0b980572ed593a96b668af6baf9b64914497f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sp=C3=B6hel?= Date: Thu, 28 Apr 2022 09:46:29 +0200 Subject: Using systemd-networkd to manage veth interfaces on host. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Spöhel Signed-off-by: Daniel Baumann --- libexec/container/start | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'libexec/container/start') diff --git a/libexec/container/start b/libexec/container/start index f899446..da6be24 100755 --- a/libexec/container/start +++ b/libexec/container/start @@ -390,15 +390,18 @@ then if [ -n "${BRIDGE}" ] && [ -n "${INTERFACE}" ] then -cat > "/etc/network/interfaces.d/${INTERFACE}" << EOF -allow-hotplug ${INTERFACE} -iface ${INTERFACE} inet manual - pre-up ip link set ${INTERFACE} up - post-up ip link set ${INTERFACE} master ${BRIDGE} - pre-down ip link set ${INTERFACE} nomaster - post-down ip link set ${INTERFACE} down + mkdir -p /run/systemd/network + +cat > "/run/systemd/network/${INTERFACE}.network" << EOF +[Match] +Name=${INTERFACE} + +[Network] +Bridge=${BRIDGE} EOF + networkctl reload + else echo "Warning bridge definition '${BRIDGE_DEFINITION}' not recognized (expected :): Ignoring" fi -- cgit v1.2.3