All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Batterbee <ian.batterbee@aut.ac.nz>
To: netfilter@lists.netfilter.org
Subject: Re: Questions re iproute2, netfilter, and locally sourced packets
Date: Mon, 15 May 2006 07:01:31 +1200	[thread overview]
Message-ID: <44677E8B.7050604@aut.ac.nz> (raw)

>
>
>A workaround is to 
>set the apparent source address explicitly with SNAT instead of 
>MASQUERADE. However, unlike MASQUERADE, SNAT assumes the output 
>interface is static and won't clean up the conntrack/NAT table when the 
>PPP interface goes down, but this is not a problem if the interface 
>always gets the same address.
>
I suspected that may be the problem, and I'm lucky because the tunnel 
does have the same IP every time, so I'll see what I can do with SNAT.

>I can't figure out how to specifically 
>> allow locally generated packets without allowing everything 
>> unconditionally.
>  
>
>
>What about using MARK in the mangle OUTPUT chain and fwmark in ip rule ?
>

I tried that, but the fwmark filter for 'ip rule' doesn't appear to work 
(or I'm doing something wrong).

If I do this:

iptables -t mangle -I OUTPUT -j MARK --set-mark 0x0001
ip rule add prio 1100 fwmark 0x0001 lookup vpn
ip route flush cache

...then the router can ping things through the tunnel, which is good, 
but ... so can every other machine on the network, which  is bad.

if I then display the rules, it shows (other rules omitted)
1100:   from all lookup vpn

ie, the fwmark condition doesn't show in the display output. I thought 
that may just be a display problem when dumping the rules, but given the 
fact that every host can ping through the tunnel, it looks like it is 
ignoring the fwmark bit, and adding it unconditionally.

I'm running iptables 1.3.5, on kernel 2.6.16.5.





             reply	other threads:[~2006-05-14 19:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-14 19:01 Ian Batterbee [this message]
2006-05-14 21:11 ` Questions re iproute2, netfilter, and locally sourced packets Pascal Hambourg
     [not found] <200605150359.k4F3xG1O006127@horuhoru-3.aut.ac.nz>
2006-05-15  6:31 ` Ian Batterbee
  -- strict thread matches above, loose matches on Subject: below --
2006-05-13  6:04 Ian Batterbee
2006-05-13 10:15 ` Pascal Hambourg
2006-05-18 13:55 ` Menno Smits

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=44677E8B.7050604@aut.ac.nz \
    --to=ian.batterbee@aut.ac.nz \
    --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.