From: "Timo Teräs" <timo.teras@iki.fi>
To: netdev@vger.kernel.org
Subject: Re: ip xfrm policy semantics
Date: Fri, 09 Jan 2009 21:21:42 +0200 [thread overview]
Message-ID: <4967A3C6.30901@iki.fi> (raw)
In-Reply-To: <496784AE.6000505@iki.fi>
Timo Teräs wrote:
> Ok, I tried to find what the code does. Apparently the ip_forward() calls
> xfrm4_route_forward() which ends up doing __xfrm_route_forward() falling
> back to xfrm_lookup() which is fixed to use XFRM_POLICY_OUT. So 'out'
> policy is always used; even for packets that are being forwarded.
>
> Ok, now I tried adding:
> policy in src pptp-server
> policy out dst pptp-server
> policy out dst internal-pptp-client
>
> all with high priority and policy 'none'. Now it looks like the packets
> from pptp-client go out to internet properly. The connection tracking
> entries are recorded, but the reply packets from pptp-server do not
> get back to internal-pptp-client. Apparently the 'none' policy prevents
> NAT to work.
Forget the above. I had a typo in my policy config.
Having:
policy out dst pptp-server
policy out dst internal-pptp-client
set to high priority and no transforms works great too.
> Any ideas what would the proper way to patch XFRM to distinguish if
> forwarded packets should be touched or not?
So basically, I would like to have separate policy for 'out' and
'fwd_out'. But adding new policy type is kinda bad. I wonder why
in the first place 'in' and 'fwd' were split, but 'out' was left
all alone without any information about if it's forwarded or local
packet?
So, I'm back to thinking how to fix this without adding IP
addresses to my security policies.
The options I could think of are:
1. A way to test input interface on policy selector
2. GRE upper layer awareness. gre key being the likely key.
(3. Splitting 'out' policy to 'out' and 'outfwd')
Any comment on which would the preferred way to go?
- Timo
prev parent reply other threads:[~2009-01-09 19:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-09 14:16 ip xfrm policy semantics Timo Teräs
2009-01-09 17:09 ` Timo Teräs
2009-01-09 19:21 ` Timo Teräs [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=4967A3C6.30901@iki.fi \
--to=timo.teras@iki.fi \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).