#!/bin/sh # A shell script update Spamhaus Lasso Spam Database for PF Firewall # Put this script at /etc/periodic/daily/10.drop-lasso file. # Tested under FreeBSD 6.x and 7.x and PF Firewall # ------------------------------------------------------------------------- # Copyright (c) 2007 nixCraft project <http://www.cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above # ------------------------------------------------------------------------- # This script is part of nixCraft shell script collection (NSSC) # Visit http://bash.cyberciti.biz/ for more information. # ---------------------------------------------------------------------- FILE=/etc/pf.drop.lasso.conf TMPO=/tmp/drop.lasso.$$ DROPURL='http://www.spamhaus.org/drop/drop.lasso' CUT=/usr/bin/cut SED=/usr/bin/sed FETCH=/usr/bin/fetch RM=/bin/rm PF="/etc/rc.d/pf restart" >$TMPO $FETCH -o $TMPO $DROPURL $CUT -d';' -f1 $TMPO | $SED -e '/^$/d' >$FILE $RM $TMPO $PF
Download this script and add following 3 lines to your /etc/pf.conf file:
table <droplasso> persist file "/etc/pf.drop.lasso.conf" #Block DROP LASSO #block log (all) all # pfctl -t droplasso -T show block drop in log (all) quick on $ext_if from <droplasso> to any block drop out log (all) quick on $ext_if from any to <droplasso>
See FreeBSD / OpenBSD: PF Firewall Filter Large Number Of Subnets and IP Address for further information.
4000+ howtos and counting! If you enjoyed this article, join 45000+ others and get free email updates!
Click here to subscribe via email.
Click here to subscribe via email.
- Download Script
- Email this to a friend
- Rss Feed
- Last Updated: 01/23/09






