Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Venkatesh. K" <venkatesh@cbayscribe.com>
To: Jose Pascual <jose.pascual@optivamedia.com>,
	netfilter@lists.netfilter.org
Subject: Re: NAT problem
Date: Mon, 6 Oct 2003 18:49:51 +0530	[thread overview]
Message-ID: <06ba01c38c0c$8de8b440$2800a8c0@karu> (raw)
In-Reply-To: 000001c38c05$923fb680$0f01a8c0@raul02

What you are trying to do is not possible with a straight forward
configuration.

You have to get the concept of DNAT right. DNAT only works when the DNAT ip
address is on seperate subnet.

For example,

192.168.0.1 <-> 192.168.0.254 <-> 192.168.1.1

you can DNAT requests coming from 192.168.0.1 to 192.168.0.254 to
192.168.1.1 by doing

/sbin/iptables -t nat -I PREROUTING -s 192.168.0.1 -p tcp --dport www -j
DNAT --to-destination 192.168.1.1

Venkatesh K

----- Original Message ----- 
From: "Jose Pascual" <jose.pascual@optivamedia.com>
To: <netfilter@lists.netfilter.org>
Sent: Monday, October 06, 2003 6:00 PM
Subject: NAT problem


> Hi all,
> I am new using iptables and surelly  this wil be an easy and stupid
question
> but perhaps you can help me. I want to understand NAT so I am trying to do
> the following:
>
> I have three computers in my LAN (192.168.1.1; 192.168.1.2 and
192.168.1.3).
> 192.168.1.1 has a web server and I would like to access it through
> 192.168.1.2 with NAT. For example openning my browser in 192.168.1.3 and
> connecting to 192.168.1.2   I  should see the same as if I connected to
> 192.168.1.1 web server directly, so I have done the following in
> 192.168.1.2:
>
>  iptables -t nat -A PREROUTING -p tcp --dport 80 -j
> DNAT --to-destination 192.168.1.1
>
>
>  iptables -t nat -A POSTROUTING -p tcp --sport 80 -j SNAT
> --to-source 192.168.1.2
>
> However it doesn't work. Anyone can help me?
>
> Thanks
>
> Regards
> Jose Pascual
>
>
>
>
>



  reply	other threads:[~2003-10-06 13:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-06 12:30 NAT problem Jose Pascual
2003-10-06 13:19 ` Venkatesh. K [this message]
2003-10-06 13:33   ` Cedric Blancher
2003-10-06 20:38 ` Joel Newkirk
  -- strict thread matches above, loose matches on Subject: below --
2004-07-13 20:40 nat problem Frans Luteijn
2004-07-13 21:06 ` Antony Stone
2004-07-13 22:21   ` Frans Luteijn
2004-07-13 22:53     ` Antony Stone
2004-07-13 23:11       ` Nick Taylor
2004-07-14  1:02       ` Frans Luteijn
2004-07-14  8:53         ` Antony Stone
2004-07-14 23:30           ` Frans Luteijn
2004-07-15  8:21             ` Antony Stone
2004-07-19  1:26               ` Frans Luteijn
2004-07-05 16:33 Frans Luteijn
2004-07-07 13:07 ` Antony Stone
2002-11-22 22:52 Yogini Parkhi
2002-11-15 20:45 Rahul Jadhav
2002-10-21 13:04 NAT problem saravanan sakthi
2002-10-21 15:15 ` Antony Stone
2002-10-20 23:20 NAT Problem Morgan
2002-06-24 11:11 Nat PROBLEM lcef
2002-06-24 13:34 ` Antony Stone
2002-06-15 22:14 Completely NAT an ISP: A practical possibility? Brian Capouch
2002-06-15 22:33 ` Antony Stone
2002-06-15 23:17   ` Nick Drage
2002-06-17  4:25     ` Sathi
2002-06-17 10:58       ` nat problem umar
2002-06-17 18:11         ` Antony Stone
2002-05-09  4:41 NAT problem Tyler Kemp
2002-06-13 16:03 ` Antony Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='06ba01c38c0c$8de8b440$2800a8c0@karu' \
    --to=venkatesh@cbayscribe.com \
    --cc=jose.pascual@optivamedia.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox