All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: netfilter@lists.netfilter.org
Subject: Re: Iptables proxy to a different network
Date: Fri, 09 Feb 2007 20:56:19 +0100	[thread overview]
Message-ID: <45CCD1E3.6010800@plouf.fr.eu.org> (raw)
In-Reply-To: <D392D4803D14354CBC49D772E19DD0CD45660D@zeus.w2k.nrlmry.navy.mil>

Andrus, Mr. Brian (Contractor) a écrit :
> 
> In the diagram:
> System A: Client
> System B: Proxy
> System C: Server
[...]
>>+---------------+
>>|   System A    |
>>+-------+-------+
>>        |
>>{===============}
>>{    Internet   }
>>{===============}
>>        |
>>+---------------+        +---A.B.C.x-----+
>>|    Router     +--------|   System B    +
>>+-------+-------+        +---------------+
>>        |
>>+-------+-------+
>>|   System C    |
>>+---X.Y.Z.x-----+

If you have the following rule in system B's nat table :

-A PREROUTING -p tcp --dport 80 -j DNAT --to ip_C

you just need to add the following rule :

-A POSTROUTING -d ip_C -p tcp --dport 80 -j SNAT --to ip_B

System C will see ip_B as the client address and will send the replies 
back to it, so system B can put back the original addresses.

I suppose you are aware that the router would be a much better place to 
to the DNAT that system B. Actually you would not need system B. I am 
not sure I understand the purpose of this setup.


  reply	other threads:[~2007-02-09 19:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-09  0:41 Iptables proxy to a different network Andrus, Mr. Brian (Contractor)
2007-02-09 11:27 ` Pascal Hambourg
2007-02-09 12:38   ` Jan Engelhardt
2007-02-09 15:22     ` Pascal Hambourg
2007-02-09 16:04       ` Andrus, Mr. Brian (Contractor)
2007-02-09 17:01         ` Pascal Hambourg
2007-02-09 18:50           ` Andrus, Mr. Brian (Contractor)
2007-02-09 19:56             ` Pascal Hambourg [this message]
2007-02-09 17:49       ` Jan Engelhardt
2007-02-09 21:38         ` Pascal Hambourg
2007-02-09 22:22           ` Jan Engelhardt
2007-02-13 20:44           ` R. DuFresne
2007-02-13 20:53             ` Jan Engelhardt

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=45CCD1E3.6010800@plouf.fr.eu.org \
    --to=pascal.mail@plouf.fr.eu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.