diff --git a/gestion/gen_confs/switchs.py b/gestion/gen_confs/switchs.py index d4c0e930..9e469f18 100755 --- a/gestion/gen_confs/switchs.py +++ b/gestion/gen_confs/switchs.py @@ -29,7 +29,7 @@ from annuaires import bat_switchs class switch(gen_config) : # Répertoire ou écire les fichiers de conf - CONF_REP='/var/tftp_switchs/' # avec un / derrière + CONF_REP='/tmp/' # avec un / derrière config = """; %(modele)s Configuration Editor; Created on release #H.08.53 @@ -47,28 +47,28 @@ snmp-server community "public" Operator ;-------------------------------------------------------- Réglage heure/date time timezone 60 time daylight-time-rule Western-Europe -sntp server 138.231.136.6 +sntp server 138.231.144.3 timesync sntp sntp unicast ;-------------------------------------------------------- Misc console inactivity-timer 30 ;-------------------------------------------------------- Logs -logging 138.231.136.7 +logging 138.231.144.7 ;-------------------------------------------------------- Logs %(INTERFACES_CONF)s ;-------------------------------------------------------- IP du switch -ip default-gateway 138.231.136.4 +ip default-gateway 138.231.144.4 vlan 1 name "DEFAULT_VLAN" untagged 1-%(nb_prises)d - ip address %(ip)s 255.255.248.0 + no ip address ip igmp no ip igmp querier exit vlan 2 - name "Wifi" - tagged %(ports_wifi)s - ip igmp blocked %(ports_wifi)s + name "Serveurs" + ip address %(ip)s 255.255.255.0 + tagged %(uplinks)s exit ;-------------------------------------------------------- Accès d'adminsitration no telnet-server @@ -77,9 +77,8 @@ aaa authentication ssh login public-key aaa authentication ssh enable public-key ip ssh ip ssh version 2 -ip authorized-managers 138.231.136.0 255.255.255.0 -ip authorized-managers 138.231.137.216 -ip authorized-managers 138.231.137.215 +ip authorized-managers 138.231.144.0 255.255.255.0 +ip ssh filetransfer ;-------------------------------------------------------- Spanning-tree spanning-tree ; Config des uplinks @@ -93,8 +92,8 @@ radius-server key %(radius_key)s %(radius-serveurs)s ;-------------------------------------------------------- Filtrage mac aaa port-access mac-based %(non_uplinks)s -aaa port-access mac-based %(non_uplinks)s addr-limit 32 -aaa port-access mac-based %(non_uplinks)s logoff-period 9999999 +aaa port-access mac-based %(non_uplinks)s addr-limit 3 +aaa port-access mac-based %(non_uplinks)s logoff-period 3600 aaa port-access mac-based addr-format multi-colon ;-------------------------------------------------------- Bricoles no cdp run @@ -108,7 +107,7 @@ no stack exit """ # Serveurs radius - rad_servs = [ '138.231.136.10' , '138.231.136.18', '138.231.136.6' ] + rad_servs = [ '138.231.144.10' , '138.231.144.18' ] rad_template = "radius-server host %s\n" def __init__(self,truc): @@ -236,10 +235,7 @@ exit 'radius-serveurs' : rad[:-1] % tuple(self.rad_servs)} # Numéro du switch - try : - sw_num = int(switch[5]) - except : - sw_num = 0 + sw_num = int(switch[5]) # Nombre de prises et modèle nb_prises = conn.nb_prises() @@ -293,7 +289,7 @@ exit prise_params['nom'] = 'Chambre' if len(chbres) > 1 : prise_params['nom'] += 's' for chbre in chbres : - prise_params['nom'] += '_' + chbre + prise_params['nom'] += '_%s%s' % (bat.upper(), chbre) # Besoin d'activer la prise ? act = 0