Thursday, May 2, 2013

Resolve Applying iptables firewall rules failed


Some time we might be get error like Applying iptables firewall rules: iptables-restore: line 1 failed [FAILED].The line Number will be different.That is nothing  while editing editing iptables you may wrongly enter some extra attributes.
For example iptable rule will be like that

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 21 -j ACCEPT

but you editing rule like

ss-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 21 -j ACCEPT

means you can get like Applying iptables firewall rules: iptables-restore: line 1[this the exact line failed] failed [FAILED].

For that you simply correct the rule and restart your iptables. And you away from that error.

If the iptable rule is correct and you getting same error means add the following line above the rules and add COMMIT statement end of the rule.Go to /etc/init.d/iptables and add

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 21 -j ACCEPT----->rule
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 25 -j ACCEPT----->rule

COMMIT


and restart your iptables .That  working fine


Donot forget to give your comments /suggestions and refer to your friends.

No comments:

Post a Comment