Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Eliezer Croitoru <eliezer@ngtech.co.il>
To: Sebastian Poehn <sebastian.poehn@googlemail.com>
Cc: jengelh@inai.de, netfilter@vger.kernel.org
Subject: Re: How to use TROXY target only for specific outgoing interface
Date: Tue, 15 Jan 2013 20:54:04 +0200	[thread overview]
Message-ID: <50F5A5CC.7090904@ngtech.co.il> (raw)
In-Reply-To: <1358275060.1792.8.camel@localhost.localdomain>

Very nice!!

Can you share this code by any chance?

Eliezer
On 1/15/2013 8:37 PM, Sebastian Poehn wrote:
> Thanks Eliezer. You are right. Creating a ipset containing all routes is
> the only thing you can do in PREROUTING. As this solution is not useable
> for me, I ended up writing a small piece of code taking a packet from
> NFQUEUE and performing a nexthop lookup and outgoing if and accordingly
> setting a fwmark.
>
> -m mark --mark LOCAL -j CONNMARK --set-mark LOCAL
> -m mark --mark WIDE -j CONNMARK --set-mark WIDE
> -m connmark --mark LOCAL -j ACCEPT
> -m connmark --mark WIDE -j TPROXY
> -m TPROXYTRAFFIC -j NFQUEUE
>
> Notice the usage of connmark so only one lookup is needed for a stream.


      reply	other threads:[~2013-01-15 18:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-13  8:54 How to use TROXY target only for specific outgoing interface Sebastian Poehn
2013-01-13 11:30 ` Jan Engelhardt
2013-01-13 16:39   ` Sebastian Poehn
2013-01-13 22:33     ` Eliezer Croitoru
2013-01-14 19:12       ` Sebastian Poehn
2013-01-15 12:02         ` Eliezer Croitoru
2013-01-15 18:37           ` Sebastian Poehn
2013-01-15 18:54             ` Eliezer Croitoru [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=50F5A5CC.7090904@ngtech.co.il \
    --to=eliezer@ngtech.co.il \
    --cc=jengelh@inai.de \
    --cc=netfilter@vger.kernel.org \
    --cc=sebastian.poehn@googlemail.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