i configured this wrong. i was using the *routed* addrs as the *client* addr, which is wrong.

This commit is contained in:
brent s. 2020-05-10 17:15:47 -04:00
parent f8bfd846b7
commit 5344a99a6b
Signed by: bts
GPG Key ID: 8C004C2F93481F6B
2 changed files with 18 additions and 14 deletions

View File

@ -15,4 +15,8 @@ update_key = xXxXxXxXxXxXxXXX
server = 192.0.2.1 server = 192.0.2.1
# And these are all the allocations you wish to add to this machine. Be sure to add the prefix (e.g. /64, /48)! # And these are all the allocations you wish to add to this machine. Be sure to add the prefix (e.g. /64, /48)!
# You can specify multiple allocations with a comma-separated list. # You can specify multiple allocations with a comma-separated list.
# ("Routed IPv6 Prefixes")
allocations = 2001:DB8:1::/64,2001:DB8:2::/64 allocations = 2001:DB8:1::/64,2001:DB8:2::/64
# This is the address to actually set on the interface. There should be only one here.
# ("Client IPv6 Address")
address = 2001:DB8:3::/64

View File

@ -105,8 +105,9 @@ class TunnelBroker(object):
self.cfg = self._conf[self.tun_id] self.cfg = self._conf[self.tun_id]
self.server = ipaddress.ip_address(self.cfg['server']) self.server = ipaddress.ip_address(self.cfg['server'])
logger.debug('Set server IP to {0}.'.format(str(self.server))) logger.debug('Set server IP to {0}.'.format(str(self.server)))
self.addrs = [ipaddress.ip_network(ip.strip()) for ip in self.cfg['allocations'].split(',')] self.allocations = [ipaddress.ip_network(ip.strip()) for ip in self.cfg['allocations'].split(',')]
logger.debug('Using address allocations: {0}'.format(', '.join([str(ip) for ip in self.addrs]))) logger.debug('Using address allocations: {0}'.format(', '.join([str(ip) for ip in self.allocations])))
self.addr = ipaddress.ip_network(self.cfg['address'].strip())
for k in ('user', 'update_key'): for k in ('user', 'update_key'):
setattr(self, k, self.cfg[k]) setattr(self, k, self.cfg[k])
# Don't log creds, even in debug. # Don't log creds, even in debug.
@ -166,18 +167,17 @@ class TunnelBroker(object):
logger.error(('Could not bring up link for iface name {0} at index {1}: ' logger.error(('Could not bring up link for iface name {0} at index {1}: '
'{2}').format(self.iface_name, self.iface_idx, e)) '{2}').format(self.iface_name, self.iface_idx, e))
raise e raise e
for a in self.addrs: try:
try: self.ipr.addr('add',
self.ipr.addr('add', index = self.iface_idx,
index = self.iface_idx, address = str(self.addr.network_address),
address = str(a.network_address), mask = self.addr.prefixlen,
mask = a.prefixlen, family = socket.AF_INET6)
family = socket.AF_INET6) logger.debug('Added address {0} to link {1}.'.format(str(self.addr), self.iface_name))
logger.debug('Added address {0} to link {1}.'.format(str(a), self.iface_name)) except Exception as e:
except Exception as e: logger.error(('Could not add address {0} on link {1}: '
logger.error(('Could not add address {0} on link {1}: ' '{2}').format(str(self.addr), self.iface_name, e))
'{2}').format(str(a), self.iface_name, e)) raise e
raise e
try: try:
self.ipr.route('add', dst = 'default', oif = self.iface_idx, family = socket.AF_INET6) 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)) logger.debug('Added default route for link {0}.'.format(self.iface_name))