summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-10-06 10:57:26 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-10-06 10:57:26 +0000
commite1f74498ceaeaa80707ea77744c76bb6690c14e0 (patch)
tree89619e92f6af8c78f513729af95f9614b5d4b10e
parentRemoving some dead code in network-veth-extra handling. (diff)
downloadcompute-tools-tmp-ifupdown.tar.xz
compute-tools-tmp-ifupdown.zip
Updating.tmp-ifupdown
-rwxr-xr-xlib/container/start13
-rwxr-xr-xlib/container/stop8
2 files changed, 6 insertions, 15 deletions
diff --git a/lib/container/start b/lib/container/start
index 566b4b0..4990bc9 100755
--- a/lib/container/start
+++ b/lib/container/start
@@ -336,16 +336,9 @@ 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
-EOF
-
+ ip link add ${INTERFACE} type veth
+ ip link set ${INTERFACE} up
+ ip link set ${INTERFACE} master ${BRIDGE}
else
echo "Warning bridge definition '${BRIDGE_DEFINITION}' not recognized (expected <bridge>:<interface>): Ignoring"
fi
diff --git a/lib/container/stop b/lib/container/stop
index 6b1c986..934db3f 100755
--- a/lib/container/stop
+++ b/lib/container/stop
@@ -186,12 +186,10 @@ case "${CLEAN}" in
for VETH in ${VETHS}
do
INTERFACE="$(echo ${VETH} | awk -F: '{ print $1 }')"
- FILE="/etc/network/interfaces.d/${INTERFACE}"
- if [ -f "${FILE}" ]
- then
- rm -f "${FILE}"
- fi
+ ip link set ${INTERFACE} nomaster
+ ip link set ${INTERFACE} down
+ ip link delete ${INTERFACE} type veth
done
;;
esac