diff --git a/gestion/gen_confs/firewall_crans.py b/gestion/gen_confs/firewall_crans.py index 394c9b66..53aed0b7 100755 --- a/gestion/gen_confs/firewall_crans.py +++ b/gestion/gen_confs/firewall_crans.py @@ -135,10 +135,26 @@ class firewall_crans : remove_lock('firewall') def nat_table(self) : - print 'bla' + self.anim = anim(' Structure de la table nat') + for chaine in [ 'TEST_MAC-IP', 'RESEAUX_NON_ROUTABLES_SRC', 'RESEAUX_NON_ROUTABLES_DST' ] : + iptables('-t nat -N %s' % chaine) + + iptables("-t nat -P PREROUTING -j ACCEPT") + iptables("-t nat -A PREROUTING -i lo -j ACCEPT") + iptables("-t nat -A PREROUTING -d 224.0.0.0/4 -j DROP") + iptables("-t nat -A PREROUTING -j RESEAUX_NON_ROUTABLES_DST") + iptables("-t nat -A PREROUTING -j RESEAUX_NON_ROUTABLES_SRC") + iptables("-t nat -A PREROUTING -j TEST_MAC-IP") + iptables("-t nat -P PREROUTING DROP") + print OK + + def nat_table_tweaks(self) : return - def filter_table(self) : + self.anim = anim(' Structure de la table filter') + print OK + + def filter_table_tweaks(self) : return def start_fw_funcs(self) : @@ -177,10 +193,10 @@ class firewall_crans : cprint(" -> fin de la procédure de démarrage",'vert') def __start(self) : - self.anim = anim(' Structure de la table nat') self.nat_table() - self.anim = anim(' Structure de la table filter') + self.nat_table_tweaks() self.filter_table() + self.filter_table_tweaks def reseaux_non_routables(self) : """ Construction de RESEAUX_NON_ROUTABLES_{DST,SRC} """