Feed iptables with a file

From banana_wiki
Revision as of 15:21, 10 April 2014 by Bananafish (talk | contribs) (Created page with "<pre>#!/bin/bash _input=./shit #IPT=/sbin/iptables #$IPT -N droplist while IFS= read -r ip do iptables -I INPUT -s $ip -j DROP done < "$_input"</pre> http://w...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#!/bin/bash
_input=./shit
#IPT=/sbin/iptables
#$IPT -N droplist
while IFS= read -r ip
do
    iptables -I INPUT -s $ip -j DROP
done < "$_input"

http://www.cyberciti.biz/faq/iptables-read-and-block-ips-subnets-from-text-file/ http://www.cyberciti.biz/tips/linux-iptables-how-to-flush-all-rules.html