Want to send list of hosts to IPTables?
I know the below question sounds like it might belong in another area, but please stick with me here ...
What command might I use to make IPTables parse a list of hostnames and add them to the firewall? I want to be able to take a list of hosts in a file called "blocklist" and use one command to add all of them to IPTables.
Say the file looks like this:
-------- Start of file ----
-------- End of file ----
I tried a command like the following:
iptables -A FORWARD -j DROP -d `more blocklist` (note the backwards apostraphes)
blocklist > iptables -A FORWARD -j DROP -d