Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-20-2008, 07:41 AM   #1
LQ Newbie
Registered: Aug 2008
Posts: 7

Rep: Reputation: 0
Question 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?


Old 09-20-2008, 09:55 AM   #2
LQ Newbie
Registered: Aug 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Red face 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.




Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem loading iptables script on startup manicajk Linux - General 8 04-12-2009 11:37 AM
iptables 1.27a still loading rules after installing iptables 1.3.0 yawe_frek Linux - Software 1 06-07-2007 09:50 PM
how to make iptables blacklist a user if they connect to a certain port GeorgeMoney Linux - Networking 5 04-08-2007 05:06 AM
?Odd bug. modprobe.blacklist~ behaves as modprobe.blacklist arubin Slackware 1 11-05-2006 07:08 PM
Problem with my iptables script please help jccurtis Linux - Networking 2 01-14-2006 05:50 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration