All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeroen Elebaut <jeroen@elebaut.com>
To: netfilter@lists.netfilter.org
Subject: Re: NATed packets only enter the default routing table
Date: Sun, 9 Apr 2006 15:56:02 +0200	[thread overview]
Message-ID: <200604091556.02586.jeroen@elebaut.com> (raw)
In-Reply-To: <20060408194058.71fa3e09.mailinglists@lucassen.org>

Hi,
i had a similar problem with our setup. The problem is i think that the 
routing decision on the linux box is made before the address in the packet is 
changed back to 1.2.3.3. So it doesn't use the source policy routing entry. I 
solved this by using the connmark module from iptables and then do routing 
based on the mark. The following should work in your setup:

iptables -t mangle -I PREROUTING -m conntrack --ctstate ESTABLISHED,RELATED -j 
CONNMARK --restore-mark
iptables -t mangle -I PREROUTING -i eth1 -m conntrack --ctstate NEW  -j 
CONNMARK --set-mark 1

ip rule add fwmark 1 lookup eth1_up


This will route everything that entered via eth1 back via eth1.

Greetings,
jeroen


  reply	other threads:[~2006-04-09 13:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-08 17:40 NATed packets only enter the default routing table richard lucassen
2006-04-09 13:56 ` Jeroen Elebaut [this message]
2006-04-09 18:30   ` richard lucassen
2006-04-09 22:00     ` Alexander Samad
  -- strict thread matches above, loose matches on Subject: below --
2006-04-08 15:07 richard lucassen

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=200604091556.02586.jeroen@elebaut.com \
    --to=jeroen@elebaut.com \
    --cc=netfilter@lists.netfilter.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.