diff options
Diffstat (limited to 'tools')
-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 |