diff --git a/systemvm/patches/debian/config/opt/cloud/bin/deleteIpAlias.sh b/systemvm/patches/debian/config/opt/cloud/bin/deleteIpAlias.sh index 47edb925450..8b1491938a1 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/deleteIpAlias.sh +++ b/systemvm/patches/debian/config/opt/cloud/bin/deleteIpAlias.sh @@ -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 \ No newline at end of file diff --git a/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh b/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh index 50f6b4df46f..ad50d4e32e9 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh +++ b/systemvm/patches/debian/config/opt/cloud/bin/ipassoc.sh @@ -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