Mikrotik : Blacklist par Pays
De www.yakakliker.org
Les Scripts
# Script de telechargement de la liste AFGHANISTAN (AF)
/system script add name="Downloadaf-aggregated" source={
/tool fetch url="http://blacklist.yakakliker.org/af-aggregated.rsc" mode=http;
:log info "af-aggregated.rsc telecharge depuis http://blacklist.yakakliker.org";
}
# Script suppression de l'ancienne liste AFGHANISTAN (AF) et ajout de la nouvelle
/system script add name="Replaceaf-aggregated" source={
/ip firewall address-list remove [find where comment="af-aggregated"]
/import file-name=af-aggregated.rsc;
:log info "Suppression de l'ancienne liste AFGHANISTAN (AF) et import de la nouvelle liste";
}
La tâche planifiée
# Planification du telechargement et de l'import de la liste AFGHANISTAN (AF)
/system scheduler add comment="Telechargement AFGHANISTAN (AF) liste" interval=7d name="Downloadaf-aggregated_List" on-event=Downloadaf-aggregated start-date=jan/01/1970 start-time=04:00:00
/system scheduler add comment="Import AFGHANISTAN (AF) Liste" interval=7d name="Installaf-aggregated_List" on-event=Replaceaf-aggregated start-date=jan/01/1970 start-time=04:15:00
Les règles de Firewall
/ip firewall raw add action=drop chain=prerouting comment="Blacklist AFGHANISTAN (AF)" log=yes src-address-list=af-aggregated
/ip firewall filter add action=drop chain=forward comment="Blacklist AFGHANISTAN (AF)" dst-address-list=af-aggregated log=yes log-prefix=AFGHANISTAN_
Liens
https://www.ipdeny.com/ipblocks/