From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Largent Subject: Re: NAT (iptables) problem (help) Date: Wed, 22 May 2002 15:02:22 -0400 Sender: linux-admin-owner@vger.kernel.org Message-ID: <3CEBEB3E.4030101@imagelinks.com> References: <1022091957007296@lycos.fr> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: List-Id: Content-Type: text/plain; charset="iso-8859-1"; To: linux-admin@vger.kernel.org Cc: rita jacques I found you also have to make sure you are allowing forwarding of port 80 to the host, and in some cases I've had to do postrouting something like: iptables -t nat -A PREROUTING -i eth0 -p tcp --dport www -j DNAT --to-d= est=20 192.168.1.20 ) iptables -t nat -A POSTROUTING -o eth0 -p tcp --sport 80 -j SNAT --to-s= ource=20 xxx.xxx.xxx.xxx iptables -A FORWARD -d 192.168.1.20 -p tcp -m tcp --dport 80 -j ACCEPT rita jacques wrote: > hi > I have a LAN (linux mandrake boxes, with IP 192.168.0.1 to=20 > 20). I have also a gateway (linux mandrake with 2 Network=20 > cards eth0 with real IP AAA.BBB.CCC.DDD and eth1 with=20 > 192.168.0.1). > What sould I do to redirect for example web request to=20 > 192.168.0.20 machine in the LAN... > I tried iptables...not working > (iptables -t nat -A PREROUTING -i eth0 -p tcp --dport www - > j DNAT --to-dest 192.168.1.20 ) >=20 > Should I use iptables on the gateway only or on the linux=20 > boxes on the LAN also? >=20 > What about SNAT? > is this correct > iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to- > source AAA.BBB.CCC.DDD=20 >=20 > Thanks > Rita >=20 > ______________________________________________________ > Bo=EEte aux lettres - Lycos - http://www.lycos.fr >=20 --=20 Jeff Largent ImageLinks, Inc. Sr System Admin Melbourne, Fl 32935 (321) 253-0011 fax:(321) 253-5559 perl -e 'print unpack(u, "3=3DW=3DW+FEM86=3DE;&EN:W,N8V]M\"@``");' - To unsubscribe from this list: send the line "unsubscribe linux-admin" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html