iptables rule problem

Posted by thakrage on Ask Ubuntu See other posts from Ask Ubuntu or by thakrage
Published on 2011-11-25T09:11:00Z Indexed on 2011/11/25 10:07 UTC
Read the original article Hit count: 159

Filed under:
|
|

I've been searching around for some time now, but nothing solves my problem. I'm setting up a mail server, but when writing to the iptables, I get an error:

iptables-restore: line 2 failed.

I'm tryig to use the following /etc/iptables.test.rules:

# Allows SMTP access
-A INPUT -p tcp --dport 25 -j ACCEPT

# Allows pop and pops connections 
-A INPUT -p tcp --dport 110 -j ACCEPT
-A INPUT -p tcp --dport 995 -j ACCEPT

# Allows imap and imaps connections 
-A INPUT -p tcp --dport 143 -j ACCEPT
-A INPUT -p tcp --dport 993 -j ACCEPT

After this, I'm issuing the following command:

sudo iptables-restore < /etc/iptables.test.rules

However I get returned this:

iptables-restore: line 2 failed.

I don't know what the problem is. Can anyone clarify?

btw. I'm using Ubuntu 10.10 LTS

© Ask Ubuntu or respective owner

Related posts about 10.10

Related posts about server