[./Python/etc/network/interfaces] Ajout de la gestion de l'ipv6
darcs-hash:20091229221115-8fbb1-48aaa4f9ee7b33d418debd47ce2eec248c7826cd.gz
This commit is contained in:
parent
554e56acf1
commit
05adbb513e
1 changed files with 31 additions and 3 deletions
|
@ -28,6 +28,16 @@ iface %(interface)s inet static
|
|||
dns-nameservers 138.231.136.10 138.231.136.9 138.231.136.3
|
||||
dns-search crans.org""" % { 'interface': interface, 'ip': pubip() }
|
||||
|
||||
for line in additionnals:
|
||||
print " ", line
|
||||
print
|
||||
|
||||
print """iface %(interface)s inet6 static
|
||||
address %(ip6)s
|
||||
netmask 64
|
||||
gateway fe80::219:bbff:fe31:3b80
|
||||
""" % { 'interface': interface, 'ip6': pubip6(interface) }
|
||||
|
||||
elif mode == "adm":
|
||||
print """auto %(interface)s
|
||||
iface %(interface)s inet static
|
||||
|
@ -39,6 +49,15 @@ iface %(interface)s inet static
|
|||
dns-nameservers 10.231.136.10 138.231.136.9 10.231.136.3
|
||||
dns-search adm.crans.org""" % { 'interface': interface, 'ip': admip() }
|
||||
|
||||
for line in additionnals:
|
||||
print " ", line
|
||||
print
|
||||
|
||||
print """iface %(interface)s inet6 static
|
||||
address %(ip6)s
|
||||
netmask 64
|
||||
""" % { 'interface': interface, 'ip6': admip6(interface) }
|
||||
|
||||
elif mode == "radin":
|
||||
print """auto %(interface)s
|
||||
iface %(interface)s inet static
|
||||
|
@ -82,14 +101,23 @@ iface %(interface)s inet static""" % { 'interface': interface }
|
|||
else:
|
||||
raise NotImplementedError, "Mode de réseau inconnu : %s" % mode
|
||||
|
||||
for line in additionnals:
|
||||
print " ", line
|
||||
print
|
||||
if mode != "pub" and mode != "adm":
|
||||
for line in additionnals:
|
||||
print " ", line
|
||||
print
|
||||
|
||||
# Définitions communes
|
||||
print """auto lo
|
||||
iface lo inet loopback
|
||||
"""
|
||||
|
||||
def pubip6(If):
|
||||
return "2a01:240:fe3d::" + If_Mac[If]
|
||||
|
||||
def admip6(If):
|
||||
return "2a01:240:fe3d:c804:" + If_Mac[If]
|
||||
|
||||
Probe_Mac = metadata.Probes["mac"].split('\n')
|
||||
If_Mac = dict(zip(Probe_Mac[:-1:2], Probe_Mac[1::2]))
|
||||
|
||||
exec metadata.Probes["interfaces_local"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue