From: Gavin Hamill <gdh@acentral.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: DNAT to another Network?
Date: Wed, 7 Jul 2004 13:07:17 +0100 [thread overview]
Message-ID: <200407071307.17282.gdh@acentral.co.uk> (raw)
In-Reply-To: <200407071129.i67BTbP22745@ps0.linanet.is>
On Wednesday 07 July 2004 12:51, Svavar Örn Eysteinsson wrote:
> Hi everybody.
>
> I have one question about DNAT.
>
> I have a computer foo.com on an ipaddress xxx.xxx.xxx.xxx
>
> Is there any way for me to DNAT all traffic with destination to foo.com
> to another server out-of-town, e.g. computer foobar.com with
> zzz.zzz.zzz.zzz that
> is not on my public network.?
Yes, basically using Computer A to be an IP-level proxy. Note that the source
address as seen by Computer B will always be that of Computer A. If this is
not a problem, you can use:
$IPTABLES -t nat -A PREROUTING -p tcp --dport 80 -d xxx.xxx.xxx.xxx -j DNAT
--to zzz.zzz.zzz.zzz
$IPTABLES -A FORWARD -p tcp --dport 80 -d xxx.xxx.xxx.xxx j ACCEPT
$IPTABLES -t nat -A POSTROUTING -p tcp --dport 80 -d zzz.zzz.zzz.zzz -j SNAT
--to xxx.xxx.xxx.xxx
Drop the '--dport 80' bits if you want all traffic, not just HTTP to be
proxied.
Cheers,
Gavin.
next prev parent reply other threads:[~2004-07-07 12:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-07 11:51 DNAT to another Network? Svavar Örn Eysteinsson
2004-07-07 12:07 ` Gavin Hamill [this message]
2004-07-07 12:22 ` Svavar Örn Eysteinsson
2004-07-07 13:40 ` Gavin Hamill
2004-07-07 12:10 ` Alexander Samad
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=200407071307.17282.gdh@acentral.co.uk \
--to=gdh@acentral.co.uk \
--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.