This commit is contained in:
brent s. 2020-05-12 20:03:18 -04:00
parent 136b41cb0e
commit b95ed24743
Signed by: bts
GPG Key ID: 8C004C2F93481F6B

View File

@ -14,8 +14,7 @@ class TunnelBroker(object):
url_ip = 'https://ipv4.clientinfo.square-r00t.net/'
params_ip = {'raw': '1'}
url_api = 'https://ipv4.tunnelbroker.net/nic/update'
# def_rt = 'default'
def_rt = '::192.88.99.1'
def_rt_ip = '::192.88.99.1'

def __init__(self, conf_xml, tun_id = None, wan_ip = True, update = True, *args, **kwargs):
self.conf_file = os.path.abspath(os.path.expanduser(conf_xml))
@ -114,7 +113,16 @@ class TunnelBroker(object):
ipr.close()
raise e
try:
ipr.route('add', dst = self.def_rt, oif = self.iface_idx, family = socket.AF_INET6)
ipr.route('add',
dst = 'default',
gateway = self.def_rt_ip,
oif = self.iface_idx,
family = socket.AF_INET6)
ipr.route('add',
dst = '::/96',
gateway = '::',
oif = self.iface_idx,
family = socket.AF_INET6)
logger.debug('Added default route for link {0}.'.format(self.iface_name))
except Exception as e:
logger.error(('Could not add default IPv6 route on link {0}: {1}').format(self.iface_name, e))
@ -133,7 +141,11 @@ class TunnelBroker(object):
logger.error('Could not set iface_idx for link {0}: {1}'.format(self.iface_name, e))
raise e
try:
ipr.route('del', dst = self.def_rt, oif = self.iface_idx, family = socket.AF_INET6)
ipr.route('del',
dst = 'default',
gateway = self.def_rt_ip,
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}: '