[ipt] On utilise le rid et pas le mid pour trouver le prefixe de la machine dans rid_primaires
Sinon, bah, ça marche pas et les gens ils sont pas déconnecté. De plus, on blacklist par mac qu'on ai trouvé l'ipv6 ou non de la machine.
This commit is contained in:
parent
bba2b1cf9b
commit
90ff8f1913
1 changed files with 5 additions and 2 deletions
|
@ -169,7 +169,7 @@ ACCEPT' % (dev, proto, ip, port))
|
||||||
def blacklist(self, machine):
|
def blacklist(self, machine):
|
||||||
''' Met des règles empêchant toute communication
|
''' Met des règles empêchant toute communication
|
||||||
vers et à partir de la machine considérée '''
|
vers et à partir de la machine considérée '''
|
||||||
ident = int(machine.id())
|
ident = int(machine.rid())
|
||||||
ip = ""
|
ip = ""
|
||||||
for type_m, plages in rid_primaires.iteritems():
|
for type_m, plages in rid_primaires.iteritems():
|
||||||
if type_m in ['special']:
|
if type_m in ['special']:
|
||||||
|
@ -180,9 +180,11 @@ ACCEPT' % (dev, proto, ip, port))
|
||||||
mac=machine.mac()
|
mac=machine.mac()
|
||||||
break
|
break
|
||||||
|
|
||||||
|
self.filter.blacklist_src('-m mac --mac-source %s -j REJECT --reject-with icmp6-port-unreachable' % mac)
|
||||||
if ip:
|
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)
|
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):
|
def version(self):
|
||||||
|
@ -774,6 +776,7 @@ def blacklist(ipt):
|
||||||
if ipt.filter.blacklist_dst.items:
|
if ipt.filter.blacklist_dst.items:
|
||||||
ipt.filter.blacklist_dst.items[:] = []
|
ipt.filter.blacklist_dst.items[:] = []
|
||||||
|
|
||||||
|
print "%s machines blacklistées" % len(blcklst)
|
||||||
for machine in blcklst:
|
for machine in blcklst:
|
||||||
ipt.blacklist(machine)
|
ipt.blacklist(machine)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue