From b1456ae16aaf79a0edad38b9a235f135abcd2a3c Mon Sep 17 00:00:00 2001 From: brent s Date: Sun, 10 May 2020 06:19:48 -0400 Subject: [PATCH] there we go. route cleanup sorted. --- utils/he_ipv6.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/he_ipv6.py b/utils/he_ipv6.py index 2dec3eb..b9979c7 100755 --- a/utils/he_ipv6.py +++ b/utils/he_ipv6.py @@ -196,15 +196,16 @@ class TunnelBroker(object): except Exception as e: logger.error('Could not set iface_idx for link {0}: {1}'.format(self.iface_name, e)) raise e - try: - self.ipr.link('set', index = self.iface_idx, state = 'down') - except Exception as e: - logger.error('Could not bring down link {0}: {1} (continuing anyways)'.format(self.iface_name, e)) try: self.ipr.route('del', dst = 'default', oif = self.iface_idx, family = socket.AF_INET6) + logger.debug('Removed default route for link {0}.'.format(self.iface_name)) except Exception as e: logger.error(('Could not remove default IPv6 route on link {0}: ' '{1} (continuing anyways)').format(self.iface_name, e)) + try: + self.ipr.link('set', index = self.iface_idx, state = 'down') + except Exception as e: + logger.error('Could not bring down link {0}: {1} (continuing anyways)'.format(self.iface_name, e)) try: self.ipr.link('del', index = self.iface_idx) logger.debug('Deleted link {0}.'.format(self.iface_name))