From: Anders Fugmann <afu@fugmann.dhs.org>
To: Peng Gao <gao@lkn.ei.tum.de>, netfilter@lists.netfilter.org
Subject: Re: Destination NAT question
Date: Tue, 24 Sep 2002 19:49:18 +0200 [thread overview]
Message-ID: <3D90A59E.9020608@fugmann.dhs.org> (raw)
In-Reply-To: 3D90972C.70204@lkn.e-technik.tu-muenchen.de
Peng Gao wrote:
> Hi,
>
> I am a student at Technical University of Munich. I am doing my thesis
> about Netfilter.
> I set up the NAPT to do the Source Address Translation by the command:
> iptables -t nat -A POSTROUTING -p udp -o eth0 -j SNAT --to 1.2.3.4:1-1023
>
> But my question is:
> Could you please tell me the command to do the Destination Address
> Translation for the reverse direction (from the public network to
> private network)?
$ iptables -t nat -A PREROUTING -p udp -o eth0 -j DNAT \
--to-destination 5.6.7.8
would make any udp connection going out on eth0 to be changed to have
destination address 5.6.7.8.
Allthough this command is the "reverse" of SNAT, they do not have to be
used in pairs.
Any responses for packets being SNAT'ed will automatically be un-NAT'ed,
because netfilter keeps track of all SNAT'ed connections and makes sure
that replies comes back to the right sender.
The same goes for DNAT.
Regards
Anders Fugmann,
prev parent reply other threads:[~2002-09-24 17:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-24 16:47 Destination NAT question Peng Gao
2002-09-24 17:49 ` Anders Fugmann [this message]
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=3D90A59E.9020608@fugmann.dhs.org \
--to=afu@fugmann.dhs.org \
--cc=gao@lkn.ei.tum.de \
--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.