From 260f544758974233fa289b841e3065bb64e5bb32 Mon Sep 17 00:00:00 2001 From: yuwenchao Date: Tue, 6 Mar 2018 16:55:31 +0800 Subject: [PATCH] script: bring up tunl0 before sysctl it for ipvs-tunnel.rs.deploy --- scripts/ipvs-tunnel.rs.deploy.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/ipvs-tunnel.rs.deploy.sh b/scripts/ipvs-tunnel.rs.deploy.sh index 24ddd0b14..a44505209 100644 --- a/scripts/ipvs-tunnel.rs.deploy.sh +++ b/scripts/ipvs-tunnel.rs.deploy.sh @@ -148,6 +148,11 @@ fi case $1 in start) + ip addr show | grep $2 > /dev/null + [ $? -ne 0 ] && ip addr add $2/32 dev tunl0 + + ip link set tunl0 up + sysctl -w net.ipv4.conf.tunl0.arp_ignore=1 > /dev/null sysctl -w net.ipv4.conf.tunl0.rp_filter=2 > /dev/null @@ -158,12 +163,6 @@ start) echo net.ipv4.conf.tunl0.arp_ignore=1 >> $sysctl_file echo net.ipv4.conf.tunl0.rp_filter=2 >> $sysctl_file - ip addr show | grep $2 > /dev/null - [ $? -ne 0 ] && ip addr add $2/32 dev tunl0 - - ip link show tunl0 | grep DOWN > /dev/null - [ $? -ne 0 ] && ip link set tunl0 up - add_tunl0_cfg $2 if [ $? -ne 0 ]; then #echo "Fail to add $ip to $tunl0_file!"