Ajout des VLAN accueil et radin à /etc/network/interfaces
darcs-hash:20080904040750-ffbb2-36837d45442db23793cdd0f66afdc9da05df3e00.gz
This commit is contained in:
parent
69e3a0590a
commit
7ab751a61e
2 changed files with 31 additions and 1 deletions
|
@ -24,7 +24,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() }
|
||||
else:
|
||||
elif mode == "adm":
|
||||
print """auto %(interface)s
|
||||
iface %(interface)s inet static
|
||||
address %(ip)s
|
||||
|
@ -34,6 +34,24 @@ 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
|
||||
address %(ip)s
|
||||
network 10.42.0.0
|
||||
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
|
||||
address %(ip)s
|
||||
network 10.51.0.0
|
||||
netmask 255.255.0.0
|
||||
broadcast 10.51.255.255
|
||||
mtu 1496""" % { 'interface': interface, 'ip': accueilip() }
|
||||
else:
|
||||
raise NotImplementedError, "Mode de réseau inconnu : %s" % mode
|
||||
|
||||
for line in additionnals:
|
||||
print " ", line
|
||||
|
|
|
@ -19,3 +19,15 @@ def pubip():
|
|||
|
||||
def admip():
|
||||
return admipof(hostname)
|
||||
|
||||
def radinip():
|
||||
if hostname == 'sable':
|
||||
return '10.42.0.1'
|
||||
else:
|
||||
raise NotImplementedError, "Ce serveur n'a rien à faire sur le VLAN radin"
|
||||
|
||||
def accueilip():
|
||||
if hostname == 'sable':
|
||||
return '10.51.0.1'
|
||||
else:
|
||||
raise NotImplementedError, "Ce serveur n'a rien à faire sur le VLAN d'accueil"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue