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... examples: 58.22.0.0/15 58.56.0.0/15 58.58.0.0/16 Here is the script: #--------------------------- grep -v "#" /etc/firewall/blacklist | sed -e '/^$/d' > /tmp/temp while read source garbage do $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? Thx, ..Rob |
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. ..Rob |
All times are GMT -5. The time now is 11:19 PM. |