diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index 7672fcd1f92..d75271c7ecb 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -419,6 +419,7 @@ setup_redundant_router() { cp /root/redundant_router/primary-backup.sh.templ $rrouter_bin_path/primary-backup.sh cp /root/redundant_router/heartbeat.sh.templ $rrouter_bin_path/heartbeat.sh cp /root/redundant_router/check_heartbeat.sh.templ $rrouter_bin_path/check_heartbeat.sh + cp /root/redundant_router/arping_gateways.sh.templ $rrouter_bin_path/arping_gateways.sh cp /root/redundant_router/check_bumpup.sh $rrouter_bin_path/ cp /root/redundant_router/disable_pubip.sh $rrouter_bin_path/ cp /root/redundant_router/checkrouter.sh.templ /root/checkrouter.sh @@ -447,6 +448,7 @@ setup_redundant_router() { sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/fault.sh sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/primary-backup.sh sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/check_heartbeat.sh + sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/arping_gateways.sh sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" /root/checkrouter.sh chmod a+x $rrouter_bin_path/*.sh diff --git a/patches/systemvm/debian/config/root/redundant_router/arping_gateways.sh.templ b/patches/systemvm/debian/config/root/redundant_router/arping_gateways.sh.templ new file mode 100644 index 00000000000..80f7f030dcb --- /dev/null +++ b/patches/systemvm/debian/config/root/redundant_router/arping_gateways.sh.templ @@ -0,0 +1,10 @@ +ip link|grep BROADCAST|grep -v eth0|grep -v eth1|cut -d ":" -f 2 > /tmp/iflist +while read i +do + ip addr show $i|grep "inet " > /tmp/iplist_$i + while read line + do + ip=`echo $line|cut -d " " -f 2|cut -d "/" -f 1` + arping -I $i -A $ip -c 2 >> [RROUTER_LOG] 2>&1 + done < /tmp/iplist_$i +done < /tmp/iflist diff --git a/patches/systemvm/debian/config/root/redundant_router/master.sh.templ b/patches/systemvm/debian/config/root/redundant_router/master.sh.templ index d935ea85b90..3c07f3ef860 100644 --- a/patches/systemvm/debian/config/root/redundant_router/master.sh.templ +++ b/patches/systemvm/debian/config/root/redundant_router/master.sh.templ @@ -31,9 +31,7 @@ if [ $ret -ne 0 ] then echo Fail to switch conntrackd mode, but try to continue working >> [RROUTER_LOG] fi -ping -n -c 3 [GATEWAY] >> [RROUTER_LOG] 2>&1 & -sleep 3 -pkill ping +[RROUTER_BIN_PATH]/arping_gateways.sh echo Status: MASTER >> [RROUTER_LOG] releaseLockFile $lock $locked