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 run_iptables -t nat -N WEAVE >/dev/null 2>&1 || true
add_iptables_rule nat POSTROUTING -j WEAVE add_iptables_rule nat POSTROUTING -j WEAVE
} }
# disable offloading - we do this even when $BRIDGE already exists if [ ! "$1" = "--without-ethtool" ] ; then
# simply because it has the desirable side-effect of ensuring we # disable offloading - we do this even when $BRIDGE already exists
# have the $TOOLS_IMAGE and thus do not incur downloading-induced # simply because it has the desirable side-effect of ensuring we
# delays in more time-sensitive sections elsewhere. # have the $TOOLS_IMAGE and thus do not incur downloading-induced
run_tool host ethtool -K $BRIDGE tx off >/dev/null # delays in more time-sensitive sections elsewhere.
run_tool host ethtool -K $BRIDGE tx off >/dev/null
fi
ip link set dev $BRIDGE up ip link set dev $BRIDGE up
} }
@@ -453,6 +455,9 @@ case "$COMMAND" in
docker pull $img docker pull $img
done done
;; ;;
create-bridge)
create_bridge --without-ethtool
;;
launch) launch)
check_not_running $CONTAINER_NAME $BASE_IMAGE check_not_running $CONTAINER_NAME $BASE_IMAGE
create_bridge create_bridge