[gen_confs/switchs.py] on rajoute le vlan 21
Ignore-this: d035e1792e12a5fedbb2d3e3c055a95d darcs-hash:20090302140835-bd074-9d2311070b88a7bd5ab1dc0a6923274666daebe9.gz
This commit is contained in:
parent
091981f029
commit
eb82b03462
1 changed files with 57 additions and 38 deletions
|
@ -78,8 +78,8 @@ vlan %(vlan_hotspot)s
|
|||
%(prises_hotspot)s
|
||||
no ip address
|
||||
exit
|
||||
vlan %(vlan_radin)s
|
||||
name "Radin"
|
||||
vlan %(vlan_gratuit)s
|
||||
name "Gratuit"
|
||||
tagged %(prises_default)s
|
||||
no ip address
|
||||
exit
|
||||
|
@ -88,6 +88,11 @@ vlan %(vlan_accueil)s
|
|||
tagged %(prises_default)s
|
||||
no ip address
|
||||
exit
|
||||
vlan %(vlan_appts)s
|
||||
name "Appt ENS"
|
||||
%(prises_appts)s
|
||||
no ip address
|
||||
exit
|
||||
;-------------------------------------------------------- Logs
|
||||
%(INTERFACES_CONF)s
|
||||
;------------------------------------------------------- Accès d'administration
|
||||
|
@ -288,11 +293,15 @@ exit
|
|||
vlans = { 'wifi_tagged' : [] , 'wifi_untagged' : [] ,
|
||||
'hotspot_tagged' : [], 'hotspot_untagged' : [],
|
||||
'adm_tagged' : [] , 'adm_untagged' : [] ,
|
||||
'appts_tagged' : [], 'appts_untagged' : [],
|
||||
|
||||
# VLans pour le reste: le vlan des adhérents, des
|
||||
# inconnus et de ceux qui ne paie pas
|
||||
'default' : [] }
|
||||
|
||||
personnels_loges = self.db.search('etudes=Personnel ENS')['adherent']
|
||||
prises_appartements= [ p.chbre() for p in personnels_loges ]
|
||||
|
||||
# Génération de la conf de chaque prise
|
||||
for prise in range(1,nb_prises+1):
|
||||
self.aff.cycle()
|
||||
|
@ -310,6 +319,7 @@ exit
|
|||
vlans['adm_tagged'].append(prise)
|
||||
vlans['wifi_tagged'].append(prise)
|
||||
vlans['hotspot_tagged'].append(prise)
|
||||
vlans['appts_tagged'].append(prise)
|
||||
params['INTERFACES_CONF'] += self.interface_template % prise_params
|
||||
continue
|
||||
|
||||
|
@ -372,6 +382,7 @@ aaa port-access mac-based %(prise)s logoff-period 3600
|
|||
aaa port-access mac-based %(prise)s unauth-vid 1
|
||||
""" % { 'nbmac': 1+2*len(chbres), 'prise': prise }
|
||||
|
||||
|
||||
# On donne à la prise un nom qui dépend des chambres
|
||||
# connectés dessus
|
||||
if chbres :
|
||||
|
@ -382,6 +393,14 @@ aaa port-access mac-based %(prise)s unauth-vid 1
|
|||
else :
|
||||
prise_params['nom'] = 'Inconnu'
|
||||
|
||||
# Si c'est une chambre d'un personnel de l'ENS, on lui donne
|
||||
# le VLAN 21 en untagged
|
||||
if chbres:
|
||||
if chbres[0] in prises_appartements: # il faudrait faire
|
||||
# un truc moins sale
|
||||
vlans['appts_untagged'].append(prise)
|
||||
prise_params['nom'] += "(appartement ENS)"
|
||||
|
||||
params['INTERFACES_CONF'] += self.interface_template % prise_params
|
||||
|
||||
# Petite verif
|
||||
|
@ -427,8 +446,8 @@ aaa port-access mac-based %(prise)s unauth-vid 1
|
|||
for key, prises in vlans.items() :
|
||||
vlans[key]=mk_list(prises)
|
||||
|
||||
# Config des vlans spéciaux (adm et wifi)
|
||||
for v in ('adm', 'wifi', 'hotspot') :
|
||||
# Config des vlans spéciaux (adm, wifi et appartements)
|
||||
for v in ('adm', 'wifi', 'hotspot', 'appts') :
|
||||
params['prises_%s' % v] = ''
|
||||
for t in ('tagged' , 'untagged') :
|
||||
if vlans['%s_%s' % (v,t)] :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue