From af2d158ff1a99dee2f032a81bf14de4144d2b82f Mon Sep 17 00:00:00 2001 From: Lucas Serrano Date: Sun, 30 Mar 2014 15:59:32 +0200 Subject: [PATCH] =?UTF-8?q?[gen=5Fconfs]=20D=C3=A9sactivation=20mdns=20swi?= =?UTF-8?q?tchs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pour empêcher les ordinateurs Apple de faire n'importe quoi… --- gestion/gen_confs/switch_conf.tpl | 5 +++++ gestion/gen_confs/switchs2.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gestion/gen_confs/switch_conf.tpl b/gestion/gen_confs/switch_conf.tpl index 4053cc9b..96e5400e 100644 --- a/gestion/gen_confs/switch_conf.tpl +++ b/gestion/gen_confs/switch_conf.tpl @@ -101,3 +101,8 @@ interface {{ port|int }} no lacp exit {%- endfor %} +;--- Filtre de protocole --- +{%- if drop_mdns %} +filter multicast 01005e0000fb drop all +filter multicast 3333000000fb drop all +{%- endif %} diff --git a/gestion/gen_confs/switchs2.py b/gestion/gen_confs/switchs2.py index 3060bf17..577edabf 100755 --- a/gestion/gen_confs/switchs2.py +++ b/gestion/gen_confs/switchs2.py @@ -336,6 +336,12 @@ def conf_switch(hostname): data['trusted'] = str(PortList(p for p in ports_list if p.is_trusted())) data['non_trusted'] = str(PortList(p for p in ports_list if not p.is_trusted())) + # On désactive le multicast mdns + if "2910" in switch['info'][0].value: + data['drop_mdns'] = True + else: + data['drop_mdns'] = False + # On render : return tpl_env.get_template('switch_conf.tpl').render(**data).encode('utf-8')