[ale] Stupid question time: PAT vs NAT

JK jknapka at kneuro.net
Tue May 8 12:57:31 EDT 2007


Ned Williams wrote:

> Ale'ers
> 
> 
> I need to do port address translation vs name address translation, is this
> something tables can do or is there another daemon I need to load to do
> such?

IIRC, PAT is simply a special case of NAT, where the translated
source IP address is == the IP on which the packet is leaving.
This used to be called "masquerading", although that's actually
a slightly different concept within iptables.  So a SNAT rule
with "--to-source <egress-interface-ip>", or a MASQUERADE
rule, should do what you want.

If you really mean "port forwarding" (eg connections to
localhost port 9000 get sent to remotehost port 15000),
then you need a REDIRECT rule.  "man iptables" is your
very good friend.

-- JK

-- 
"What can be asserted without evidence can also be
dismissed without evidence." -- Christopher Hitchens



More information about the Ale mailing list