All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Clark <sclark46@earthlink.net>
To: Chris Wilson <chris-netfilter-110904@aptivate.org>
Cc: Netfilter Developer Mailing List <netfilter-devel@vger.kernel.org>
Subject: Re: SNAT before IPSEC - why?
Date: Sat, 08 Oct 2011 17:15:27 -0400	[thread overview]
Message-ID: <4E90BD6F.40101@earthlink.net> (raw)
In-Reply-To: <alpine.DEB.2.00.1110080902550.3657@lap-x201>

On 10/08/2011 04:06 AM, Chris Wilson wrote:
> Hi Stephen,
>
> On Fri, 7 Oct 2011, Stephen Clark wrote:
>
>> What is the reasoning for having SNAT happen before ipsec encryption?
>
> You might well want to SNAT or MASQUERADE packets going through the 
> tunnel, to have them fit within the tunnel's subnet, for example if 
> you add a new local subnet and you don't want to reconfigure thousands 
> of clients.
>
>> It forces one to add special rules in the NAT table to keep this from 
>> happening
>
> You mean "iptables -t nat -A POSTROUTING -m policy --pol ipsec -j 
> ACCEPT"? Doesn't seem very onerous to me.
>
No, but that is different than what I had been using which is:
-A POSTROUTING -o eth1 -s 10.152.35.0/24 -d 10.159.95.0/24 -j ACCEPT

How does -m policy --pol ipsec figure in? I am somewhat new to iptables 
having
been working with ipfilter/ipnat on FreeBSD for the last 10 years, so 
pardon my
ignorance.

> Cheers, Chris.


-- 

"They that give up essential liberty to obtain temporary safety,
deserve neither liberty nor safety."  (Ben Franklin)

"The course of history shows that as a government grows, liberty
decreases."  (Thomas Jefferson)




  reply	other threads:[~2011-10-08 21:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-08  2:08 SNAT before IPSEC - why? Stephen Clark
2011-10-08  8:06 ` Chris Wilson
2011-10-08 21:15   ` Stephen Clark [this message]
2011-10-08  9:13 ` Michal Kubecek
2011-10-08  9:26 ` Jan Engelhardt
2011-10-08 21:09   ` Stephen Clark
2011-10-08 22:27     ` Jan Engelhardt
2011-10-09  1:01       ` Stephen Clark
2011-10-09  1:12         ` Stephen Clark
2011-10-09  1:35           ` Jan Engelhardt

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=4E90BD6F.40101@earthlink.net \
    --to=sclark46@earthlink.net \
    --cc=chris-netfilter-110904@aptivate.org \
    --cc=netfilter-devel@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.