diff --git a/utils/he_ipv6.py b/utils/he_ipv6.py index 0990239..975dd34 100755 --- a/utils/he_ipv6.py +++ b/utils/he_ipv6.py @@ -182,6 +182,21 @@ class TunnelBroker(object): logger.error(('Could not add address {0} on link {1}: ' '{2}').format(str(self.addr), self.iface_name, e)) raise e + for a in self.allocations: + try: + _addr = next(a.hosts()) + self.ipr.addr('add', + index = self.iface_idx, + address = str(_addr), + mask = a.prefixlen, + family = socket.AF_INET6) + logger.debug('Added address {0} to link {1} with prefix {2}.'.format(str(_addr), + self.iface_name, + a.prefixlen)) + except Exception as e: + logger.error(('Could not add address {0} on link {1}: ' + '{2}').format(str(self.addr), self.iface_name, e)) + raise e try: self.ipr.route('add', dst = 'default', oif = self.iface_idx, family = socket.AF_INET6) logger.debug('Added default route for link {0}.'.format(self.iface_name))