Skip to content

Commit

Permalink
script: bring up tunl0 before sysctl it for ipvs-tunnel.rs.deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwenchao authored and beacer committed Mar 28, 2018
1 parent 7f84292 commit 260f544
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/ipvs-tunnel.rs.deploy.sh
Expand Up @@ -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

Expand All @@ -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!"
Expand Down

0 comments on commit 260f544

Please sign in to comment.