From 465b16e6680a86bc72de2e2ddda222cf5487b449 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 11 Jun 2015 14:52:27 +0100 Subject: [PATCH] Give -iprange a default, and check if it is free --- weave | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/weave b/weave index 2e941902..5a141f31 100755 --- a/weave +++ b/weave @@ -984,6 +984,14 @@ case "$COMMAND" in esac done eval "set -- $ARGS" + if [ -z "$IPRANGE" ] ; then + IPRANGE="-iprange 10.128.0.0/9" + if ! netcheck ${IPRANGE#* } ; then + echo "Default" $IPRANGE "overlaps with existing route." >&2 + echo "Please pick another range and set it on all hosts." >&2 + exit 1 + fi + fi # Set WEAVE_DOCKER_ARGS in the environment in order to supply # additional parameters, such as resource limits, to docker # when launching the weave container.