Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Thomas Themel <themel@iwoars.net>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] fwmark routing of locally generated packets
Date: Tue, 04 Nov 2003 10:26:24 +0000	[thread overview]
Message-ID: <marc-lartc-106794209121085@msgid-missing> (raw)
In-Reply-To: <marc-lartc-106730159403106@msgid-missing>

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

Hi,
Thomas Themel (themel@iwoars.net) wrote on 2003-11-01:
> # SNAT for outgoing packets
> iptables -A POSTROUTING -t nat -o $PPP_IFACE --match mark --mark 0x03 -j SNAT --to-source $PPP_LOCAL

I've been able to do away with the DNAT rule now.

> # DNAT for incoming packets
> iptables -t nat -A PREROUTING -i $PPP_IFACE  -d $PPP_LOCAL -j DNAT --to-destination 192.168.1.1

I couldn't get it to work with just the SNAT rule originally (see
original post, the SACKs would be ignored), but I've finally figured out
why: I had enabled rp_filter on that machine.  

Quite obviously, enabling rp_filter in combination with policy routing
is a bad idea.

echo 0 > /proc/sys/net/ipv4/conf/$PPP_IFACE/rp_filter 

fixed it for me.

I still think I shouldn't need the netfilter SNAT rule, but even
enabling NAT with the routing rule (ip rule add fwmark 3 table aonc nat
$PPP_REMOTE) doesn't seem to set the source address of the outgoing
packets correctly.

ciao,
-- 
[*Thomas  Themel*] "If we're not supposed to eat animals, how come 
[extended contact]  they're made of meat?"
[info provided in]      - Treat Carnivores Ethically,
[*message header*]              in the fuckedcompany.com forums

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      parent reply	other threads:[~2003-11-04 10:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-28  0:32 [LARTC] fwmark routing of locally generated packets Thomas Themel
2003-10-28 16:20 ` Thomas Themel
2003-11-01  4:37 ` Brad Barnett
2003-11-01 10:39 ` Thomas Themel
2003-11-04 10:26 ` Thomas Themel [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=marc-lartc-106794209121085@msgid-missing \
    --to=themel@iwoars.net \
    --cc=lartc@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