[firewall_new] Utilisation de firewall_new dans regenerate macip

Ignore-this: 478b4193e24e87f5d49cd7f5faf9b8f9
Une solution plus propre dans generate.py serait la bienvenue ...

darcs-hash:20120229003444-28565-24c4e1aa6e34229d67143c8c55a715d0dd14042e.gz
This commit is contained in:
Daniel STAN 2012-02-29 01:34:44 +01:00
parent 62bb8ed1eb
commit 3169b58f2e
2 changed files with 8 additions and 8 deletions

View file

@ -348,10 +348,6 @@ class firewall_crans :
if adh_maj :
self.exception_catcher(self.adh_maj_list_to_do)
#~ def mac_ip_maj(self,ip_list) :
#~ # <!>
#~ """ Mise à jour de la correspondance MAC-IP pour les ip fournies (à ré-implémenter aussi) """
def build_chaine_adherent(self,chaine,methode) :
# On construit d'abord les autorisations particulières
if not self.build_chaine(chaine, methode) :
@ -1403,8 +1399,8 @@ class firewall_gordon(firewall_crans) :
"""
Structure du firewall :
table nat :
MAC-IP
table filter :
MAC-IP
FORWARD (policy par défaut : ACCEPT)
INPUT (policy par défaut : ACCEPT)
table mangle :
@ -1416,8 +1412,8 @@ class firewall_gordon(firewall_crans) :
eth_crans = "eth0"
eth_wifi = "eth0.3"
def nat_table(self) :
self.anim = anim('\tStructure de la table nat')
def filter_table(self) :
self.anim = anim('\tStructure de la table filter')
iptables('-t filter -N TEST_MAC-IP')
iptables("-t filter -P FORWARD ACCEPT")

View file

@ -125,7 +125,11 @@ class base_reconfigure:
service.reconfigure()
def macip(self, ips):
import firewall
if hostname in ['gordon','komaz']:
import firewall_new
firewall = firewall_new
else:
import firewall
cprint(u"Mise a jour correspondance MAC-IP", 'gras')
eval("firewall.firewall_%s()" % hostname).mac_ip_maj(ips)