diff --git a/README.md b/README.md index 8bb25988..abd2a532 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,8 @@ application containers. On $HOST2 we run host2# weave expose 10.0.1.102/24 -choosing an unused IP address in the application subnet. +choosing an unused IP address in the application subnet. (There is a +corresponding 'hide' command to revert this step.) Now diff --git a/weaver/weave b/weaver/weave index 95e1b89f..7979e0de 100755 --- a/weaver/weave +++ b/weaver/weave @@ -6,6 +6,7 @@ usage() { echo "weave launch / [-passwd ] ..." echo "weave run / ..." echo "weave expose /" + echo "weave hide /" echo "weave stop" exit 1 } @@ -89,6 +90,16 @@ case "$COMMAND" in fi exit 0 ;; + hide) + [ $# -gt 0 ] || usage + IPADDR=$1 + shift 1 + if ip addr list dev $BRIDGE | grep -qF $IPADDR + then + ip addr del dev $BRIDGE $IPADDR + fi + exit 0 + ;; stop) docker kill weave > /dev/null docker rm weave > /dev/null