diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-24 21:38:45 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-24 21:38:45 -0800 |
commit | c0b90c40ae42fb0dc3088376a147ddfd5835519f (patch) | |
tree | 9f316a604d2309917e69ac89b85e69d07ecaadd2 | |
parent | 1e61c57c160e63940ba85b13ff81a88e899e443d (diff) |
tools: support for gobgp on host
Easier for development.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rwxr-xr-x | tools/route-server/route-server-docker.sh | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/route-server/route-server-docker.sh b/tools/route-server/route-server-docker.sh index c9aad6ad..144fbade 100755 --- a/tools/route-server/route-server-docker.sh +++ b/tools/route-server/route-server-docker.sh @@ -4,6 +4,7 @@ NR_PEERS=8 BRIDGE_NAME=br0 CONFIG_DIR=/usr/local/gobgp GOBGP_DOCKER_NAME=gobgp +USE_HOST=0 check_user() { if [ `whoami` = "root" ]; then @@ -32,13 +33,15 @@ delete_bridge() { fi } -while getopts c:n: OPT +while getopts c:n:u OPT do case $OPT in c) CONFIG_DIR="$OPTARG" ;; n) NR_PEERS="$OPTARG" ;; + u) USE_HOST=1 + ;; *) echo "Unknown option" exit 1 ;; @@ -55,8 +58,12 @@ case "$1" in run_quagga $i i=$(( i+1 )) done - docker run --privileged=true -v $CONFIG_DIR:/mnt -d --name $GOBGP_DOCKER_NAME -id osrg/gobgp - sudo pipework $BRIDGE_NAME $GOBGP_DOCKER_NAME 10.0.255.1/16 + if [ $USE_HOST -eq 1 ]; then + sudo ip addr add 10.0.255.1/16 dev $BRIDGE_NAME + else + docker run --privileged=true -v $CONFIG_DIR:/mnt -d --name $GOBGP_DOCKER_NAME -id osrg/gobgp + sudo pipework $BRIDGE_NAME $GOBGP_DOCKER_NAME 10.0.255.1/16 + fi ;; stop) i=1 |