Add create-bridge command

This commit is contained in:
Ilya Dmitrichenko committed 2015-01-22 18:04:22 +00:00
1 parent 6253be6ecf
commit dfd7d0fe54
1 file changed
+10 -5
+10 -5
View File
@@ -139,11 +139,13 @@ create_bridge() {
run_iptables -t nat -N WEAVE >/dev/null 2>&1 || true
add_iptables_rule nat POSTROUTING -j WEAVE
}
# disable offloading - we do this even when $BRIDGE already exists
# simply because it has the desirable side-effect of ensuring we
# have the $TOOLS_IMAGE and thus do not incur downloading-induced
# delays in more time-sensitive sections elsewhere.
run_tool host ethtool -K $BRIDGE tx off >/dev/null
if [ ! "$1" = "--without-ethtool" ] ; then
# disable offloading - we do this even when $BRIDGE already exists
# simply because it has the desirable side-effect of ensuring we
# have the $TOOLS_IMAGE and thus do not incur downloading-induced
# delays in more time-sensitive sections elsewhere.
run_tool host ethtool -K $BRIDGE tx off >/dev/null
fi
ip link set dev $BRIDGE up
}
@@ -453,6 +455,9 @@ case "$COMMAND" in
docker pull $img
done
;;
create-bridge)
create_bridge --without-ethtool
;;
launch)
check_not_running $CONTAINER_NAME $BASE_IMAGE
create_bridge