[dhcp_new,generate,switchs,ldap_crans] On ajoute dhcp à générate et son ip dans dhcp-snooping, on active le dhcp-nopping sur tous les vlan.
Ignore-this: c3a151a94e71f2bb4761a9ecc9707bcf darcs-hash:20121025212409-3a55a-cd8c2857721d655c5dd67124a380fbe7eb5161b3.gz
This commit is contained in:
parent
f33d5aa50b
commit
ce443b9bfa
4 changed files with 39 additions and 7 deletions
|
@ -143,10 +143,16 @@ no stack
|
|||
"""
|
||||
|
||||
dhcp_snooping_template = """;------------------------------------------------------- DHCP Snooping
|
||||
dhcp-snooping vlan %(vlan_adherent)s
|
||||
dhcp-snooping vlan %(vlan_adherent)s %(vlan_wifi)s %(vlan_accueil)s %(vlan_gratuit)s %(vlan_isolement)s %(vlan_appts)s
|
||||
dhcp-snooping trust %(uplinks)s
|
||||
no dhcp-snooping trust %(non_uplinks)s
|
||||
dhcp-snooping authorized-server %(dhcp)s
|
||||
dhcp-snooping authorized-server %(dhcp-1)s
|
||||
dhcp-snooping authorized-server %(dhcp-3)s
|
||||
dhcp-snooping authorized-server %(dhcp-6)s
|
||||
dhcp-snooping authorized-server %(dhcp-7)s
|
||||
dhcp-snooping authorized-server %(dhcp-9)s
|
||||
dhcp-snooping authorized-server %(dhcp-21)s
|
||||
; Activation
|
||||
dhcp-snooping"""
|
||||
|
||||
|
@ -162,7 +168,15 @@ exit
|
|||
rad_template = "radius-server host %s\n"
|
||||
|
||||
# Serveur DHCP du vlan par défaut
|
||||
dhcp_server = "138.231.136.9"
|
||||
dhcp_servers = { '0':'138.231.136.9',
|
||||
'1':'138.231.136.34',
|
||||
'3':'138.231.148.34',
|
||||
'6':'10.42.0.34',
|
||||
'7':'10.51.0.34',
|
||||
'9':'10.52.0.34',
|
||||
'21':'10.2.9.34'
|
||||
}
|
||||
|
||||
|
||||
def __init__(self,truc):
|
||||
""" truc est soit :
|
||||
|
@ -279,7 +293,7 @@ exit
|
|||
# Batiment et numéro du switch
|
||||
bat = switch[3].lower()
|
||||
sw_num = int(switch[5])
|
||||
dhcp_server = self.dhcp_server
|
||||
dhcp_servers = self.dhcp_servers
|
||||
# Conf radius
|
||||
sys.path.append('/usr/scripts/gestion/secrets')
|
||||
from secrets import radius_key
|
||||
|
@ -294,7 +308,9 @@ exit
|
|||
params = { 'switch' : switch, 'bat' : bat.upper() ,
|
||||
'radius_key' : radius_key ,
|
||||
'radius-serveurs' : rad[:-1] % tuple(self.rad_servs),
|
||||
'dhcp': dhcp_server}
|
||||
'dhcp': dhcp_servers['0']}
|
||||
for i in dhcp_servers.keys():
|
||||
params['dhcp-%s' % i]=dhcp_servers[i]
|
||||
|
||||
self.aff.cycle()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue