iptables problem with port translation



I'm having a very strange intermittent problem getting iptables to
work performing port address translation. I'm running a Tomcat web
server on my server on a non-priviledged port and trying to redirect
traffic from ports 80 and 443 to ports 8080 and 8443 respectively on
a virtual IP address:

/sbin/iptables -t nat -A PREROUTING -p tcp -i eth0 --dst #{ip} --
dport 80 -j DNAT --to-destination #{ip}:8080
/sbin/iptables -t nat -A PREROUTING -p tcp -i eth0 --dst #{ip} --
dport 443 -j DNAT --to-destination #{ip}:8443

Generally speaking, everything works fine, unless I'm trying to
download large files (1MB+) in size, and then the connection will
freeze up from both the client's and server's perspective (both think
the connection is established, but all tcp traffic has ceased.) This
does not happen every time, or in the same point in the download, but
it only happens when iptables is performing the PAT, if I run Tomcat
as root and bind directly to 80 and 443 then the problem never occurs.
I've also noticed that it's less likely to occur while I'm running
tcpdump to monitor the traffic, this may be making the root cause less
likely to trigger. I've also observed via tcpdump that the client does
notice the pause and attempts to send TCP resets, but the server has
"gone quiet" at this point. The server is running CentOS 4.4 with
iptables 1.3.5. Anyone have any ideas what might be causing the
connection problems or how I can track this down?

Thanks in advance,
Jason Blumenkrantz

.



Relevant Pages

  • Re: NIS client couldnt log in
    ... >> off iptables, the client bound to the server and all the yptools ... and ypbind in broadcast mode (ypcat and ypwhich would ... >> work at all if i specified the server). ... Further, ypbind uses the ...
    (RedHat)
  • Need help configuring IPtables w/ DMZ, 2 LAN, and INET
    ... I am desperately in need of assistance in configuring an IPtables ... firewall on a Red Hat Linux 9.0 server. ... Chain FORWARD ... tcp dpt:25 flags:0x16/0x02 ...
    (comp.os.linux.networking)
  • Static IP w/ PPPoe xDSL Firewall
    ... iptables -F -t nat ... # Kill malformed XMAS packets ... # Refuse incoming packets pretending to be from the external address. ... # server/client to server query or response ...
    (comp.os.linux.networking)
  • Re: Modprobe question
    ... >> Made some minor changes to iptables and did a restart. ... >> modprobe seems to be doing something but I can't tell what. ... >> course the server seems to be running fine. ...
    (alt.linux)
  • connection lost when scanned with nmap - iptables
    ... The iptables script applied to the NIC is shown below. ... the web server or ssh into the server when I do this scan. ... echo 2> $f ... # Refuse packets claiming to be from a Class A private network. ...
    (comp.os.linux.security)