Board logo

標題: Automatically Updated VoIP Blacklist(volunteer needed!) [打印本頁]

作者: Qnewbie    時間: 2016-11-5 06:13     標題: Automatically Updated VoIP Blacklist(volunteer needed!)

本帖最後由 Qnewbie 於 2016-11-5 06:15 編輯

The VoIP Blacklist is maintained by voipbl.org. Voipbl.org provides a configuration to block ip addresses in the blacklist with fai2ban.

For mikrotik user, we might use this blacklist according to
http://joshaven.com/resources/tr ... ated-address-list/.

1. Bash script to create VoipBL.rsc, some volunteers(I mean 電腦超人 ) could run it frequently with cron and provide VoipBL.rsc for download?
  1. #!/bin/sh

  2. ####
  3. # Orig.: http://joshaven.com/resources/tricks/mikrotik-automatically-updated-address-list/
  4. ####

  5. saveTo=/var/www
  6. now=$(date);
  7. echo "# Generated by Qnewbie on $now" > $saveTo/VoipBL.rsc
  8. echo "/ip firewall address-list" >> $saveTo/VoipBL.rsc
  9. wget -q -O - http://www.voipbl.org/update |  awk ' $1 != "#" { print "add list=blacklist address=" $1 " comment=VoipBL";}'  >> $saveTo/VoipBL.rsc
複製代碼
2. It is not applicable as VoipBL.rsc is not available in telecom-cafe.
Mikrotik daily update script:
  1. # Script which will download the VoIPBL list as a text file
  2. /system script add name="DownloadVoIPBL" source={
  3. /tool fetch url="http://www.telecom-cafe.com/VoipBL.rsc" mode=http;
  4. :log info "Downloaded VoipBL.rsc from telecom-cafe.com";
  5. }

  6. # Script which will Remove old VoIPBL records and add new one
  7. /system script add name="ReplaceVoIPBL" source={
  8. /ip firewall address-list remove [find where comment="VoIPBL"]
  9. /import file-name=VoipBL.rsc;
  10. :log info "Removed old VoIPBL records and imported new list";
  11. }

  12. # Schedule the download and application of the VoIPBL list
  13. /system scheduler add comment="Download VoIPBL list" \
  14.   interval=1d name="DownloadVoIPBL_List" on-event=DownloadVoIPBL \
  15.   start-date=jan/01/1970 start-time=16:38:48
  16. /system scheduler add comment="Apply VoIPBL List" \
  17.   interval=1d name="InstallVoIPBL_List" on-event=ReplaceVoIPBL \
  18.   start-date=jan/01/1970 start-time=16:43:48
複製代碼
Possible problem:
The address list might be too looooooong... Hopefully someone might merge addresses with larger subnet.




歡迎光臨 電訊茶室 (http://telecom-cafe.com/forum/) Powered by Discuz! 7.2