返回列表 發帖
本帖最後由 Qnewbie 於 2013-12-29 21:44 編輯

No tested in RPi, nor guarantee it works@RPi. Just scratch.

1. Run once the following script,
  1. wget -qO - http://www.voipbl.org/update/ > $HOME/currentlist.txt
  2. cat $HOME/currentlist.txt | awk '{ if ($0 !~ /^192\.168\.|^10\.|^172\.1[6789]\.|^172\.2[0-9]\.|^172\.3[01]\./) print}' | awk '{print "iptables -A INPUT -s "$1" -j DROP"}' |sh
複製代碼
2. Following the instructions in voipbl.org, modify the /usr/local/bin/voipbl.sh as following:
  1. #!/bin/bash
  2. #Get newest list
  3. wget -qO - http://www.voipbl.org/update/ >  $HOME/newlist.txt
  4. #Get different list
  5. awk 'FNR==NR{old[$0];next};!($0 in old)'  $HOME/currentlist.txt  $HOME/newlist.txt >  $HOME/difflist.txt
  6. # add new list to iptable
  7. cat  $HOME/difflist.txt | awk '{ if ($0 !~ /^192\.168\.|^10\.|^172\.1[6789]\.|^172\.2[0-9]\.|^172\.3[01]\./) print}' | awk '{print "iptables -A INPUT -s "$1" -j DROP"}' |sh
  8. #renew the current list
  9. mv  $HOME/newlist.txt  $HOME/currentlist.txt
複製代碼
RB750G, RB2011UAS-2HnD
IP01, A580IP, AT-610

TOP

返回列表