Quand on a 2 interface 6, on rajoute un mode public pour éviter d'avoir 2 fois fe80:: en gateway (plantage de if)

This commit is contained in:
Gabriel Detraz 2015-06-21 17:16:12 +02:00
parent b73a417aa7
commit 13b2e1bd3f

View file

@ -226,7 +226,7 @@ def interface6(interface, list_ip, mode = 'serveur'):
'netmask': (main_ip.split('/') + ['64'])[1], 'netmask': (main_ip.split('/') + ['64'])[1],
}) })
# Avoid loops # Avoid loops
if mode != 'routeur': if mode != 'routeur' and mode != 'public':
out(' gateway fe80::1') out(' gateway fe80::1')
for ip in list_ip: for ip in list_ip:
out(' up ip a add %s dev $IFACE' % (ip,)) out(' up ip a add %s dev $IFACE' % (ip,))
@ -238,7 +238,7 @@ def pub6(interface, mode='serveur', list_ip=[]):
list_ip = [pubip6(interface) + '/64'] + list_ip list_ip = [pubip6(interface) + '/64'] + list_ip
interface6(interface, list_ip, mode=mode) interface6(interface, list_ip, mode=mode)
def wifi6(interface, list_ip=[], name=None): def wifi6(interface, list_ip=[], name=None, mode = 'serveur'):
conf_prefix = "fda8:5d34:a228:c04:%s/64" conf_prefix = "fda8:5d34:a228:c04:%s/64"
list_ip = [ "2a01:240:fe3d:c04:%s/64" % eui64(interface), list_ip = [ "2a01:240:fe3d:c04:%s/64" % eui64(interface),
conf_prefix % eui64(interface), conf_prefix % eui64(interface),
@ -246,7 +246,7 @@ def wifi6(interface, list_ip=[], name=None):
if name is not None: if name is not None:
list_ip.append(conf_prefix % str64(name)) list_ip.append(conf_prefix % str64(name))
interface6(interface, list_ip) interface6(interface, list_ip, mode=mode)
def adm6(interface): def adm6(interface):
out("""iface %(interface)s inet6 static out("""iface %(interface)s inet6 static