Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal@plouf.fr.eu.org>
To: netfilter@vger.kernel.org
Subject: Re: Wrong routing when combining ip rule with SNAT
Date: Wed, 18 Sep 2013 01:23:48 +0200	[thread overview]
Message-ID: <5238E484.80802@plouf.fr.eu.org> (raw)
In-Reply-To: <43783AC5-55D5-4AAE-A629-6B2C99AAC8E4@alex.org.uk>

Alex Bligh a écrit :
> 
> I don't think you need iptables. The way I've always done it is:
> * Default route to the VPN device
> * /32 route for the VPN endpoint out the physical interface to
>   the previous default route

This does not meet the following OP's requirement :

>> The hard part is to also tunnel non-VPN connections to the VPN node
>> itself. In other words how do I make sure that every connection to the
>> external ip of the VPN node is tunneled through its internal ip --
>> except for the packets that form the tunnel itself?

However I am not sure this is a sensible requirement.

>> My idea was install a default route to the internal ip of the VPN node,
>> use iptables to mark the VPN connections and then set up a special
>> routing table for those.

Sounds good. Make sure that packets related to the VPN connection (e.g.
ICMP error messages) are routed outside the tunnel too. I guess that can
be done with connmark (connection mark).

  reply	other threads:[~2013-09-17 23:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13  5:10 Wrong routing when combining ip rule with SNAT Nikolaus Rath
2013-09-13  6:26 ` Vigneswaran R
2013-09-13 16:09   ` Nikolaus Rath
2013-09-13 22:03     ` Nikolaus Rath
2013-09-14 13:41   ` Pascal Hambourg
2013-09-14 15:40     ` Nikolaus Rath
2013-09-14 17:17       ` Pascal Hambourg
2013-09-16  7:14       ` Vigneswaran R
2013-09-16 23:38 ` Eliezer Croitoru
2013-09-17  0:58   ` Nikolaus Rath
2013-09-17 12:35     ` Alex Bligh
2013-09-17 23:23       ` Pascal Hambourg [this message]
2013-09-18  0:55         ` Nikolaus Rath
2013-09-18  7:58           ` Alex Bligh
2013-09-18 17:38             ` Nikolaus Rath
2013-09-18 20:11               ` Alex Bligh
2013-09-19  2:29                 ` Nikolaus Rath
2013-09-17 21:58     ` Eliezer Croitoru
2013-09-18  0:58       ` Nikolaus Rath
2013-09-18  5:54     ` Vigneswaran R
2013-09-18 17:51       ` Nikolaus Rath
2013-09-19  9:25         ` Vigneswaran R

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=5238E484.80802@plouf.fr.eu.org \
    --to=pascal@plouf.fr.eu.org \
    --cc=netfilter@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox