Blacklist pour shorewall

Visiteur
Visiteur
Code BASH :
#!/bin/sh echo "#ADDRESS/SUBNET PROTOCOL PORT" > /tmp/blacklist wget -q -O - http://feeds.dshield.org/block.txt | awk --posix '/^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.0t/ { print $1 "/24";}' >> /tmp/blacklist wget -q -O - http://www.spamhaus.org/drop/drop.lasso | awk --posix '/^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}// { print $1;}' >> /tmp/blacklist echo "#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE" >> /tmp/blacklist mv /tmp/blacklist /etc/shorewall/blacklist shorewall refresh &>/dev/null
a copier dans un fichier texte que vous nommerez shorewall_blacklist.sh
ensuite éditer en root le fichier :
etc/shorewall/interfaces
et rajouter a toutes vos interfaces accédant a internet comme suit blacklist
Caché :
#
# Shorewall version 4 - Interfaces File
#
# For information about entries in this file, type "man shorewall-interfaces"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-interfaces.html
#
###############################################################################
###############################################################################
net wlan0 detect blacklist
net eth1 detect blacklist
net eth0 detect blacklist
# Shorewall version 4 - Interfaces File
#
# For information about entries in this file, type "man shorewall-interfaces"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-interfaces.html
#
###############################################################################
###############################################################################
net wlan0 detect blacklist
net eth1 detect blacklist
net eth0 detect blacklist
loguer vous en console root
Code BASH :
sh shorewall_blacklist.sh
puis
Code BASH :
/sbin/shorewall restart
ATTENTION SI VOUS AVEZ DEJA UNE BLACKLIST PENSEZ A COPIER LES IP, RANG D'IP CONTENU POUR ENSUITE LES RAJOUTER A LA NOUVELLE BLACKLIST
TOUT EN SACHANT QUE TOUJOURS LA DERNIERE LIGNE SERA :
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
Édité par Visiteur Le 23/12/2013 à 17h13
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie