From 0cd6342912a09793639d78282133d39d3ac216d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Mon, 25 Aug 2014 20:45:37 +0200 Subject: [PATCH] Le parefeu est odlyd --- gestion/gen_confs/firewall4/komaz.py | 6 +++--- gestion/gen_confs/generate.py | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/gestion/gen_confs/firewall4/komaz.py b/gestion/gen_confs/firewall4/komaz.py index 4f13244f..13f629d3 100644 --- a/gestion/gen_confs/firewall4/komaz.py +++ b/gestion/gen_confs/firewall4/komaz.py @@ -167,7 +167,7 @@ class firewall(base.firewall_routeur): chain = super(self.__class__, self).test_mac_ip() if table == 'filter': - for key in ['out', 'tun-ovh' ]: + for key in ['out', 'tun-soyouz' ]: self.add(table, chain, '-i %s -j RETURN' % dev[key]) return super(self.__class__, self).test_mac_ip(table, fill_ipset, apply) @@ -192,8 +192,8 @@ class firewall(base.firewall_routeur): if table == 'filter': pretty_print(table, chain) for net in base.config.NETs['adm']: - self.add(table, chain, '-o %s -s %s -j ACCEPT' % (dev['tun-ovh'], net)) - self.add(table, chain, '-i %s -d %s -j ACCEPT' % (dev['tun-ovh'], net)) + self.add(table, chain, '-o %s -s %s -j ACCEPT' % (dev['tun-soyouz'], net)) + self.add(table, chain, '-i %s -d %s -j ACCEPT' % (dev['tun-soyouz'], net)) self.add(table, chain, '-d %s -j REJECT' % net) print OK diff --git a/gestion/gen_confs/generate.py b/gestion/gen_confs/generate.py index cc0d8cc2..3cb6fada 100755 --- a/gestion/gen_confs/generate.py +++ b/gestion/gen_confs/generate.py @@ -213,6 +213,12 @@ class thot(base_reconfigure): self._do(machines(), self._machines()) class odlyd(base_reconfigure): + def __fw6(self): + if not hasattr(self, '__real_fw6'): + from firewall6 import Update + self.__real_fw6 = Update() + return self.__real_fw6 + def filtrage_exemptions(self): from gen_confs.filtrage import exemptions self._do(exemptions()) @@ -221,6 +227,19 @@ class odlyd(base_reconfigure): from gen_confs.filtrage import machines self._do(machines(), self._machines()) + def macip(self, ips): + cprint(u"Mise a jour correspondance MAC-IP", 'gras') + self._fw().mac_ip_maj(ips) + self.__fw6().macs([], 6) + + def ports(self, ips): + self._fw().filtrage_ports_maj(ips) + #self.__fw6().ports(map(self.midt.from_ipv4, ips), 6) + + def blacklist(self, ips): + self._fw().blacklist_maj(ips) + self.__fw6().blacklist(6) + class zamok(base_reconfigure): def del_user(self, args): # Suppression des fichies d'impression