Page 1 of 1

iptables

Posted: Wed Oct 29, 2008 9:45 pm
by Deborah
HI,

I'm getting this error when trying to restore my iptables:

iptables-restore v1.3.8: iptables-restore: unable to initialize table 'nat'

This is my file:

# Generated by iptables-save v1.3.8 on Wed Oct 29 11:32:31 2008
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -i eth+ -p tcp --dport 25 -j REDIRECT --to-port 8025
COMMIT
*mangle
:PREROUTING ACCEPT [411:33624]
:INPUT ACCEPT [411:33624]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [269:34680]
:POSTROUTING ACCEPT [269:34680]
COMMIT
# Completed on Wed Oct 29 11:32:31 2008
# Generated by iptables-save v1.3.8 on Wed Oct 29 11:32:31 2008
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [269:34680]
:RH-Firewall-1-INPUT - [0:0]
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8044 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
COMMIT
# Completed on Wed Oct 29 11:32:31 2008


Can anyone help me with this? Thanks.
Deborah

Posted: Thu Oct 30, 2008 4:08 pm
by maschoff
The 4th line of the NAT section has to be moved to the FILTER filter section (before COMMIT).

Posted: Thu Oct 30, 2008 4:39 pm
by Deborah
Thanks MA,

I now get this error:
FATAL: Could not load /lib/modules/2.6.9-023stab044.4-smp/modules.dep: No such file or directory
iptables-restore v1.3.8: iptables-restore: unable to initialize table 'nat'