getting an "operation not supported"

This commit is contained in:
brent s. 2020-05-10 03:58:38 -04:00
parent 847b96d001
commit 24ebe9082b
Signed by: bts
GPG Key ID: 8C004C2F93481F6B

View File

@ -72,12 +72,12 @@ class TunnelBroker(object):
if not self.ipr: if not self.ipr:
self.ipr = IPRoute() self.ipr = IPRoute()
self.ipr.link('add', self.ipr.link('add',
ifname = 'sit-he-{0}'.format(self.tun_id), ifname = 'sit_he-{0}'.format(self.tun_id),
kind = 'sit', kind = 'sit',
ipip_local = self.my_ip, ipip_local = self.my_ip,
ipip_remote = self.server, ipip_remote = self.server,
ipip_ttl = 255) ipip_ttl = 255)
self.iface_idx = self.ipr.link_lookup(ifname = 'sit-he-{0}'.format(self.tun_id))[0] self.iface_idx = self.ipr.link_lookup(ifname = 'sit_he-{0}'.format(self.tun_id))[0]
self.ipr.link('set', index = self.iface_idx, state = 'up', mtu = 1480) self.ipr.link('set', index = self.iface_idx, state = 'up', mtu = 1480)
for a in self.addrs: for a in self.addrs:
self.ipr.addr('add', self.ipr.addr('add',
@ -92,7 +92,7 @@ class TunnelBroker(object):
def stop(self): def stop(self):
if not self.ipr: if not self.ipr:
self.ipr = IPRoute() self.ipr = IPRoute()
self.iface_idx = self.ipr.link_lookup(ifname = 'sit-he-{0}'.format(self.tun_id))[0] self.iface_idx = self.ipr.link_lookup(ifname = 'sit_he-{0}'.format(self.tun_id))[0]
self.ipr.link('set', index = self.iface_idx, state = 'down') self.ipr.link('set', index = self.iface_idx, state = 'down')
self.ipr.route('del', dst = '::', mask = 0, oif = self.iface_idx, family = socket.AF_INET6) self.ipr.route('del', dst = '::', mask = 0, oif = self.iface_idx, family = socket.AF_INET6)
self.ipr.link('set', index = self.iface_idx, state = 'down') self.ipr.link('set', index = self.iface_idx, state = 'down')