Not related but you can use "lookup tables". Instead of a file, you can use a lookup table to save a large set of IP addresses, port numbers, etc. For example:
# IPs i want to block
exec < /etc/rc.ipfw_blocked_ip.txt
while read ip
do
$ipfw -q table 2 add $ip
done
$ipfw -q add deny ip from table\(2\) to any in via $oif
The text file is just a simple list of dotted-decimal IP addresses, one per line.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.