From 3b3e55450973d60896e132e2f46b78e42883a450 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Mon, 20 Apr 2015 12:42:52 +0200 Subject: [PATCH] Support de ra guard sur les procurve 2620 --- gestion/gen_confs/switch_conf.tpl | 5 ++++- gestion/gen_confs/switchs2.py | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gestion/gen_confs/switch_conf.tpl b/gestion/gen_confs/switch_conf.tpl index bef331d9..9f2078ec 100644 --- a/gestion/gen_confs/switch_conf.tpl +++ b/gestion/gen_confs/switch_conf.tpl @@ -80,7 +80,10 @@ dhcp-snooping authorized-server {{ s }} ; Activation dhcp-snooping {%- endif %} - +{% if ra_filter %};--- RA guards --- +ipv6 ra-guard ports {{ non_trusted }} +no ipv6 ra-guard ports {{ trusted }} +{% endif %} ;--- Config des prises --- {%- for port in ports %} {%- if port.radius_auth() %} diff --git a/gestion/gen_confs/switchs2.py b/gestion/gen_confs/switchs2.py index 331d0efc..d9aa966a 100755 --- a/gestion/gen_confs/switchs2.py +++ b/gestion/gen_confs/switchs2.py @@ -520,6 +520,12 @@ def conf_switch(hostname): first = netaddr.IPNetwork(net_of_vlan_name(vname)[0]).first data['dhcp_servers'].append(str(netaddr.IPAddress(first + rid))) + # Ra gards ne concerne que les 2620 + if "2620" in switch['info'][0].value: + data['ra_filter'] = True + else: + data['ra_filter'] = False + # Switch avec des ports gigabit uniquement if imodel in GIGABIT_MODELS: data['gigabit'] = True