CLOUDSTACK-7544: Fixed ip addr del issues in ipassoc

This commit is contained in:
Jayapal 2014-09-11 17:09:56 +05:30
parent f0e82f340a
commit 3cb6d4a4df
2 changed files with 12 additions and 1 deletions

View File

@ -56,5 +56,5 @@ service apache2 restart
releaseLockFile $lock $locked
#recreating the active ip aliases
/root/createIpAlias.sh $2
/opt/cloud/bin/createIpAlias.sh $2
unlock_exit $? $lock $locked

View File

@ -197,6 +197,7 @@ remove_snat() {
fi
local pubIp=$1
local ipNoMask=$(echo $1 | awk -F'/' '{print $1}')
logger -t cloud "$(basename $0):Removing SourceNAT $pubIp on interface $ethDev"
sudo iptables -t nat -D POSTROUTING -j SNAT -o $ethDev --to-source $ipNoMask;
return $?
@ -262,6 +263,16 @@ remove_first_ip() {
sudo ip link set $ethDev down
return 1
fi
for ipMask in $existingIpMask
do
if [ "$ipMask" == "$pubIp" ]
then
continue
fi
sudo ip addr add dev $ethDev $ipMask brd +
done
sed -i /"$ethDev "/d $IFACEGWIPFILE
remove_routing $1
sudo ip link set $ethDev down