From 5344a99a6bc880398b2785407a2f9948ae2e91ab Mon Sep 17 00:00:00 2001 From: brent s Date: Sun, 10 May 2020 17:15:47 -0400 Subject: [PATCH] i configured this wrong. i was using the *routed* addrs as the *client* addr, which is wrong. --- utils/example.he_tunnelbroker.ini | 4 ++++ utils/he_ipv6.py | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/utils/example.he_tunnelbroker.ini b/utils/example.he_tunnelbroker.ini index 57ed164..7acbffa 100644 --- a/utils/example.he_tunnelbroker.ini +++ b/utils/example.he_tunnelbroker.ini @@ -15,4 +15,8 @@ update_key = xXxXxXxXxXxXxXXX 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)! # You can specify multiple allocations with a comma-separated list. +# ("Routed IPv6 Prefixes") 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 diff --git a/utils/he_ipv6.py b/utils/he_ipv6.py index f81652e..c3a45f5 100755 --- a/utils/he_ipv6.py +++ b/utils/he_ipv6.py @@ -105,8 +105,9 @@ class TunnelBroker(object): self.cfg = self._conf[self.tun_id] self.server = ipaddress.ip_address(self.cfg['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(',')] - logger.debug('Using address allocations: {0}'.format(', '.join([str(ip) for ip in self.addrs]))) + 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.allocations]))) + self.addr = ipaddress.ip_network(self.cfg['address'].strip()) for k in ('user', 'update_key'): setattr(self, k, self.cfg[k]) # 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}: ' '{2}').format(self.iface_name, self.iface_idx, e)) raise e - for a in self.addrs: - try: - self.ipr.addr('add', - index = self.iface_idx, - address = str(a.network_address), - mask = a.prefixlen, - family = socket.AF_INET6) - logger.debug('Added address {0} to link {1}.'.format(str(a), self.iface_name)) - except Exception as e: - logger.error(('Could not add address {0} on link {1}: ' - '{2}').format(str(a), self.iface_name, e)) - raise e + try: + self.ipr.addr('add', + index = self.iface_idx, + address = str(self.addr.network_address), + mask = self.addr.prefixlen, + family = socket.AF_INET6) + logger.debug('Added address {0} to link {1}.'.format(str(self.addr), self.iface_name)) + 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))