I'm using my RedHat 7.2 box to do NAT via iptables. I'm having trouble
getting the iptables init script to configure the rules.
I can run the command (iptables -t nat -A POSTROUTING -o eth0 -s
192.168.50.0/255.255.255.240 -j MASQUERADE) manually, and the box will masq
properly.
I saved the ruleset with iptables-save > /etc/sysconfig/iptables. The file
is written properly, and the iptables init script appears to be setting
everything up correctly. Even after running the iptables startup script
after a reboot, running iptables-save returns the correct ruleset, but the
machine does not masquerade anything. I have to run the command manually,
then it will masquerade everything from my internal network properly.
I've also noticed that iptables -L does not return any rule info on the
masquerade rule, regardless of whether or not I run the iptables init script
or the masquerade command manually.
Here's the output of iptables-save:
-----
# Generated by iptables-save v1.2.4 on Sat Dec 29 16:06:24 2001
*nat
:PREROUTING ACCEPT [53:10026]
:POSTROUTING ACCEPT [7:552]
:OUTPUT ACCEPT [7:552]
-A POSTROUTING -s 192.168.50.0/255.255.255.240 -o eth0 -j MASQUERADE
COMMIT
# Completed on Sat Dec 29 16:06:24 2001
# Generated by iptables-save v1.2.4 on Sat Dec 29 16:06:24 2001
*filter
:INPUT ACCEPT [834:54183]
:FORWARD ACCEPT [530:292786]
:OUTPUT ACCEPT [595:76685]
COMMIT
# Completed on Sat Dec 29 16:06:24 2001
-----
I have verified that ipchains is not running on the box (I've even removed
it). I had this same problem when I ran RH 7.1 on the same machine. I
completely reinstalled the OS on the machine (using 7.2), and I'm still
running into this problem.
Anyone have any ideas?