diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py index 41b5e9a9168..f74ff479123 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py @@ -307,7 +307,7 @@ class CsIP: # The code looks redundant here, but we actually have to cater for routers and # VPC routers in a different manner. Please do not remove this block otherwise # The VPC default route will be broken. - if self.get_type() in ["public"]: + if self.get_type() in ["public"] and address["device"] in PUBLIC_INTERFACE: gateway = str(address["gateway"]) route.add_defaultroute(gateway) else: diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py index 77d0a6b9ccf..92f27cedc16 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py @@ -41,6 +41,7 @@ from CsRoute import CsRoute import socket from time import sleep +PUBLIC_INTERFACE = ['eth0', 'eth1'] class CsRedundant(object): @@ -228,7 +229,7 @@ class CsRedundant(object): self.set_lock() logging.info("Router switched to fault mode") - ips = [ip for ip in self.address.get_ips() if ip.is_public()] + ips = [ip for ip in self.address.get_ips() if ip.is_public() and ip.get_device() in PUBLIC_INTERFACE] for ip in ips: CsHelper.execute("ifconfig %s down" % ip.get_device()) @@ -257,7 +258,7 @@ class CsRedundant(object): logging.debug("Setting router to backup") dev = '' - ips = [ip for ip in self.address.get_ips() if ip.is_public()] + ips = [ip for ip in self.address.get_ips() if ip.is_public() and ip.get_device() in PUBLIC_INTERFACE] for ip in ips: if dev == ip.get_device(): continue @@ -291,7 +292,7 @@ class CsRedundant(object): logging.debug("Setting router to master") dev = '' - ips = [ip for ip in self.address.get_ips() if ip.is_public()] + ips = [ip for ip in self.address.get_ips() if ip.is_public() and ip.get_device() in PUBLIC_INTERFACE] route = CsRoute() for ip in ips: if dev == ip.get_device():