-   Linux - Newbie (
-   -   script problem loading blacklist in iptables (

Rob_G_ 09-20-2008 07:41 AM

script problem loading blacklist in iptables
Hi, I'm trying to load a blacklist in iptables rules through my firewall script. When I run the script, it tells me that the mask is invalid???

I have a list of networks that I want to blacklist. The entries in the list follow this format "xx.xx.xx.xx/xx" (without quotes of course); one per line...


Here is the script:
grep -v "#" /etc/firewall/blacklist | sed -e '/^$/d' > /tmp/temp

while read source garbage
$IPT -A BLACKLIST -s $source -j DROP
done < /tmp/temp

when I run the script, it outputs this to the console:
' specified.3.8: invalid mask `14
Try `iptables -h' or 'iptables --help' for more information.

However, I can successfully type the command in the console.

Any idea what is wrong?



Rob_G_ 09-20-2008 09:55 AM

Resolved ...
OK, seems it was a source file problem.

The text was copied from notepad and for some reason, it didn't like it.

I re-did the file (again copied from notepad) and it is now loading.

Not sure what hapenned... it's the exact same content.


All times are GMT -5. The time now is 09:59 AM.