All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ron McKown <lartc@winlink.ru>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] NAT/MASQ with multiple external static IPs
Date: Fri, 24 Nov 2006 12:05:38 +0000	[thread overview]
Message-ID: <4566E012.7090803@winlink.ru> (raw)
In-Reply-To: <4559C167.3050300@winlink.ru>

Покотиленко Костик wrote:
> I don't think so. You should (need) use either -j MASQUERADE or -j SNAT.
> MASQUERADE is almost the same with SNAT, it more convient for NAT'ing on
> ppp interfaces where there are different IP on each connect, that's way
> it doesn't have --to-source option (it takes the address from the
> outgoing interface).
>
> The correct way would probably be:
>
> iptables -A POSTROUTING -t nat -s 1.2.3.4 -o eth0 -j SNAT --to-source
> 1.2.3.5-1.2.3.7
>
> OR
>
> iptables -A POSTROUTING -t nat -s 1.2.3.4 -o eth0 -j SNAT --to-source
> 1.2.3.5 --to-source 1.2.3.6 --to-source 1.2.3.7
>
>   


I understand, so outbound packets will convert to the (--to-source) 
address outbound.  But how will packets coming back in find their way 
back to the original client?

For example, if I had this rule:
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -j SNAT --to-source 1.2.3.4

then sure, a packet from IP 192.168.0.50 goes out just fine.  But then I 
would need a DNAT rule to send packets back to that internal IP address. 

How would that work?  Am I looking at this the right way?

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

      parent reply	other threads:[~2006-11-24 12:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 13:15 [LARTC] NAT/MASQ with multiple external static IPs Ron McKown
2006-11-14 13:23 ` 
2006-11-24 12:05 ` Ron McKown [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=4566E012.7090803@winlink.ru \
    --to=lartc@winlink.ru \
    --cc=lartc@vger.kernel.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.