bit more. i think i need to add both the allocations and the client ip

This commit is contained in:
brent s. 2020-05-10 19:16:26 -04:00
parent 0b07050ce4
commit 276aa01928
Signed by: bts
GPG Key ID: 8C004C2F93481F6B

View File

@ -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))