Iptables and Port Forwarding Issues.

spears.chris_at_gmail.com
Date: 09/28/05


Date: 28 Sep 2005 11:34:47 -0700

I am trying to forward a single port from the outside box (linux) to
the inside box (win2k3 server). The service on the inside machine is a
webserver on a nonstandard port.

I have tried these iptables lines and they have failed me.

iptables -t nat -A PREROUTING -p tcp -i eth0 -d 65.xx.xx.xx --dport 188
-j DNAT --to 192.168.1.xxx:188
iptables -A FORWARD -p tcp -i eth0 -d 192.168.1.xxx --dport 188 -j
ACCEPT

My setup.

internt <---> 65.*.*.* eth0 <linux box> 192.168.1.1 eth0:0 <--->
192.168.1.* <win2k3 server>

>>From the linux machine I can request pages from the 192.168.1.* address
just fine http://192.168.1.*:188 I want to be able to access the pages
via 65.*.*.*:188

the only other rules I use are:
   echo 1 > /proc/sys/net/ipv4/ip_forward
   iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE



Relevant Pages

  • Re: Is Linux affected by Spywares, Viruses and Trojans?
    ... >> Is Mandrake Linux 10.1 PowerPack affected by any Viruses, Spywares, ... > the installer didnt bother to change the defaults. ... > entry. ... > appear to be multiple efforts at a single port since that might mean they ...
    (comp.os.linux.security)
  • Re: unix or linux?
    ... > Problem with ports today: you cannot install a single port ... same dependency under Linux, period, package system be dammed. ...
    (comp.unix.bsd.freebsd.misc)
  • Internet
    ... I have a Linux 7.3 that I am trying to connect to my Win2k3 server. ... The network has two other XPs.All computers ping successfully ... However I cannot get internet on the Linux. ...
    (comp.os.linux.networking)