Commit 65109b42 authored by Federico Sismondi's avatar Federico Sismondi

undo last commit : forced-bootstrap doesnt touch the OS ipv6_forwaring flags,...

undo last commit : forced-bootstrap doesnt touch the OS ipv6_forwaring flags, new feat: interface.autoconf is set to zero for linux tun creation, in macos this cannot be hanlded on a interface per interface basis so better leave it like that which just makes it more verbose on the wire
parent 6dcba6ae
......@@ -45,7 +45,7 @@ class TunConsumer(BaseConsumer):
name=name,
ipv6_host=ipv6_host,
ipv6_prefix=ipv6_prefix,
ipv6_no_forwarding=True,
ipv6_no_forwarding=False,
ipv4_host=None,
ipv4_network=None,
ipv4_netmask=None,
......
......@@ -465,12 +465,24 @@ class OpenTunLinux(object):
# =====
log.info("disabling IPv6 autoconf...")
os.system('echo 0 > /proc/sys/net/ipv6/conf/{interface_name}/autoconf'.format(
interface_name=self.ifname)
)
# =====
if self.ipv6_no_forwarding:
log.info("disabling IPv6 forwarding...")
os.system('echo 0 > /proc/sys/net/ipv6/conf/all/forwarding')
os.system('echo 0 > /proc/sys/net/ipv6/conf/{interface_name}/forwarding'.format(
interface_name=self.ifname)
)
else:
log.info("enabling IPv6 forwarding...")
os.system('echo 1 > /proc/sys/net/ipv6/conf/all/forwarding')
os.system('echo 1 > /proc/sys/net/ipv6/conf/{interface_name}/forwarding'.format(
interface_name=self.ifname)
)
# =====
log.info('\ncreated following virtual interface:')
......@@ -644,7 +656,6 @@ class OpenTunMACOS(object):
tun_counter = 0
while tun_counter < 16:
try:
import os
self.ifname = 'tun{0}'.format(tun_counter)
f = os.open("/dev/{0}".format(self.ifname), os.O_RDWR)
break
......@@ -692,6 +703,10 @@ class OpenTunMACOS(object):
log.info("enabling IPv6 forwarding...")
os.system('sysctl -w net.inet6.ip6.forwarding=1')
# =====
# TODO find a way of disabling router solicitations for the opened interface
# =====
log.info('\ncreated following virtual interface:')
os.system('ifconfig {0}'.format(self.ifname))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment