Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wico/9467748 to your computer and use it in GitHub Desktop.
Save wico/9467748 to your computer and use it in GitHub Desktop.
DROP="`wget -qO- http://www.spamhaus.org/drop/drop.txt`";for i in `echo $DROP|egrep -o "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,3}"|sort -n`; do route add -net $i reject; done;EDROP="`wget -qO- http://www.spamhaus.org/drop/edrop.txt`";for i in `echo $EDROP|egrep -o "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,3}"|sort -n`; do route add -net $i reject; done
@wico
Copy link
Author

wico commented Mar 10, 2014

Fetches fresh rules, applies them - only using bash, wget, egrep, sort and route. No disk access - good for small routers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment