* Destination NAT question
@ 2002-09-24 16:47 Peng Gao
2002-09-24 17:49 ` Anders Fugmann
0 siblings, 1 reply; 2+ messages in thread
From: Peng Gao @ 2002-09-24 16:47 UTC (permalink / raw)
To: netfilter
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)?
Thanks a lot!
Best wishes!
Peng Gao
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Destination NAT question
2002-09-24 16:47 Destination NAT question Peng Gao
@ 2002-09-24 17:49 ` Anders Fugmann
0 siblings, 0 replies; 2+ messages in thread
From: Anders Fugmann @ 2002-09-24 17:49 UTC (permalink / raw)
To: Peng Gao, netfilter
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,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-09-24 17:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-24 16:47 Destination NAT question Peng Gao
2002-09-24 17:49 ` Anders Fugmann
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.