Linux Netfilter discussions
 help / color / mirror / Atom feed
From: RUMI Szabolcs <rumi_ml@rtfm.hu>
To: netfilter@vger.kernel.org
Cc: Marco Berizzi <pupilla@hotmail.com>
Subject: Re: MASQUERADE/SNAT before IPsec
Date: Sun, 3 Feb 2008 01:10:09 +0100	[thread overview]
Message-ID: <20080203011009.14cf09ea.rumi_ml@rtfm.hu> (raw)
In-Reply-To: <BAY103-DAV9E97CD56D54A10E4D90C4B2310@phx.gbl>

[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]

On Sat, 2 Feb 2008 22:42:57 +0100
"Marco Berizzi" <pupilla@hotmail.com> wrote:

> RUMI Szabolcs wrote:
> 
> > Hello!
> > 
> > I'm trying to achieve the following:
> > 
> > I would like to connect a LAN behind a NAT gateway to an IPsec VPN.
> > The IPsec VPN gets connected to via IPsec tunnelmode by the NAT
> > gateway that is getting a single dynamic IP address valid on the
> > VPN and this is what the LAN machines had to be MASQUERADEd to.
> > 
> > On the NAT gateway a WAN address is assigned to eth0 and the
> > dynamic IPsec VPN address is assigned to eth0:0. I can ping hosts
> > on the IPsec VPN through the tunnel from the NAT gateway itself
> > but I cannot ping them from any LAN hosts behind the gateway.
> > 
> > The problem is that when I set up proper FORWARD and MASQUERADE
> > rules for the LAN network, the MASQUERADEd packets seem to go out
> > on eth0 unencrypted without ever getting into the IPsec tunnel. I
> > have also tried -j SNAT --to-source <address of eth0:0 valid on
> > IPsec VPN> just to be sure and the same thing happens as with
> > MASQUERADE.
> > 
> > Environment: linux-2.6.22, iptables-1.3.8
> > 
> > Is this behaviour intentional?
> > How could I achieve what I described above?
> 
> may draw your network schema?

Well the actual setup is much more complicated but I tried
to simplify and visualize the problem (see attached image).
The green arrows show where the NATed traffic should go and
the red ones show what actually happens.

Best regards,
Sab

[-- Attachment #2: ipsec_nat_2.png --]
[-- Type: image/png, Size: 20945 bytes --]

  parent reply	other threads:[~2008-02-03  0:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-02 21:00 MASQUERADE/SNAT before IPsec RUMI Szabolcs
     [not found] ` <BAY103-DAV9E97CD56D54A10E4D90C4B2310@phx.gbl>
2008-02-03  0:10   ` RUMI Szabolcs [this message]
2008-02-03 13:18     ` Marco Berizzi
2008-02-03 18:19       ` RUMI Szabolcs
2008-02-04  9:48         ` Marco Berizzi
2008-02-04 11:26           ` RUMI Szabolcs

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=20080203011009.14cf09ea.rumi_ml@rtfm.hu \
    --to=rumi_ml@rtfm.hu \
    --cc=netfilter@vger.kernel.org \
    --cc=pupilla@hotmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox