diff --git a/gestion/ipt.py b/gestion/ipt.py index 919fcd55..70ca4d7c 100644 --- a/gestion/ipt.py +++ b/gestion/ipt.py @@ -169,7 +169,7 @@ ACCEPT' % (dev, proto, ip, port)) def blacklist(self, machine): ''' Met des règles empêchant toute communication vers et à partir de la machine considérée ''' - ident = int(machine.id()) + ident = int(machine.rid()) ip = "" for type_m, plages in rid_primaires.iteritems(): if type_m in ['special']: @@ -180,9 +180,11 @@ ACCEPT' % (dev, proto, ip, port)) mac=machine.mac() break + self.filter.blacklist_src('-m mac --mac-source %s -j REJECT --reject-with icmp6-port-unreachable' % mac) if ip: - self.filter.blacklist_src('-m mac --mac-source %s -j REJECT --reject-with icmp6-port-unreachable' % mac) self.filter.blacklist_dst('-d %s -j REJECT --reject-with icmp6-adm-prohibited' % ip) + else: + print "Ipv6 de la machine %s impossible à calculer" % machine.nom() def version(self): @@ -774,6 +776,7 @@ def blacklist(ipt): if ipt.filter.blacklist_dst.items: ipt.filter.blacklist_dst.items[:] = [] + print "%s machines blacklistées" % len(blcklst) for machine in blcklst: ipt.blacklist(machine)