Blacklist IP file for IPFW?

ajtiM starikarp at dismail.de
Tue Feb 18 16:08:56 UTC 2020


On Tue, 18 Feb 2020 17:00:25 +0300

I am starting with:
ipfw table 1 create
cat /etc/bogons | xargs -n1 ipfw table 1 add
ipfw table 2 create
cat /etc/mine | xargs -n1 ipfw table 2 add
....
....
and than I have

$cmd 00600 deny ip from 'table(1)' to any
$cmd 00650 deny log ip from 'table(2)' to any

I did use script before:
#!/bin/csh
 	ipfw table 1 create
fetch -o /tmp/drop.txt http://www.spamhaus.org/drop/drop.txt
sed -i '' "s/;.*//" /tmp/drop.txt
ipfw table 1 flush
foreach IP ( `cat /tmp/drop.txt` )
        ipfw table 1 add $IP
end

and I have in ipf.rules:
# Get ip's from Spamhaus
# /etc/tables.sh

-- 
"The only difference between a beggar and a Duke was the amount of
money they possess".

George Orwell


More information about the freebsd-questions mailing list