[./Python/etc/network/interfaces] Lisibilité
darcs-hash:20090329180931-8fbb1-385bcbfdacafabe0e217cafc57c994287f397971.gz
This commit is contained in:
parent
8494237a2b
commit
81b21b5739
1 changed files with 8 additions and 5 deletions
|
@ -11,7 +11,6 @@ Voir http://wiki.crans.org/CransTechnique/Bcfg2/... pour plus d'explications.
|
|||
def dev(interface, mode, additionnals=[]):
|
||||
"""Génération de la conf d'une interface:
|
||||
|
||||
- mode est soit pub soit adm
|
||||
- additionnals contient des lignes à mettre en plus à la définition"""
|
||||
|
||||
if mode == "pub":
|
||||
|
@ -24,6 +23,7 @@ iface %(interface)s inet static
|
|||
gateway 138.231.136.4
|
||||
dns-nameservers 138.231.136.10 138.231.136.9 138.231.136.3
|
||||
dns-search crans.org""" % { 'interface': interface, 'ip': pubip() }
|
||||
|
||||
elif mode == "adm":
|
||||
print """auto %(interface)s
|
||||
iface %(interface)s inet static
|
||||
|
@ -34,6 +34,7 @@ iface %(interface)s inet static
|
|||
mtu 1496
|
||||
dns-nameservers 10.231.136.10 138.231.136.9 10.231.136.3
|
||||
dns-search adm.crans.org""" % { 'interface': interface, 'ip': admip() }
|
||||
|
||||
elif mode == "radin":
|
||||
print """auto %(interface)s
|
||||
iface %(interface)s inet static
|
||||
|
@ -42,6 +43,7 @@ iface %(interface)s inet static
|
|||
netmask 255.255.0.0
|
||||
broadcast 10.42.255.255
|
||||
mtu 1496""" % { 'interface': interface, 'ip': radinip() }
|
||||
|
||||
elif mode == "accueil":
|
||||
print """auto %(interface)s
|
||||
iface %(interface)s inet static
|
||||
|
@ -50,6 +52,7 @@ iface %(interface)s inet static
|
|||
netmask 255.255.0.0
|
||||
broadcast 10.51.255.255
|
||||
mtu 1496""" % { 'interface': interface, 'ip': accueilip() }
|
||||
|
||||
elif mode == "ens":
|
||||
print """auto %(interface)s
|
||||
iface %(interface)s inet static
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue