From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: s sg <ssg2351@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: ipt_reject.c --> ip_route_me_harder ... --> ip_route_output_slow: iif is loopback device?
Date: Tue, 11 May 2010 12:59:06 +0200 [thread overview]
Message-ID: <4BE9387A.8080806@plouf.fr.eu.org> (raw)
In-Reply-To: <AANLkTimahQnqdaHEEB1UgkdG7mp9vysHZNvWKpPTcxI5@mail.gmail.com>
Hello,
s sg a écrit :
>
> I meet a routing issue when I try to use ipt_reject RST target in my
> policy routing enabled linux box (please see below picture).
>
> The linux box is configured to support policy routing, iif policy. The
> policy is, if packet is from interface group1, then it will lookup
> table 100, this table's default oif is wan1. And if packet is from
> interface group2, then it will lookup table 101, this table's default
> oif is wan2. The main table's default oif is wan1.
>
> The issue is, one packet comes from group2 and then ipt_reject wants
> to send RST, but the routing for the RST packet fail
> (ip_route_me_harder fail).
>
> I trace the code in ipt_REJECT.c. ipt_REJECT.c use ip_route_me_harder
> to find the RST packet's destination. ip_route_me_harder will first
> find the RST packet's reverse path using ip_route_output_key. The
> trace of ip_route_output_key is like this:
> ip_route_me_harder --> ip_route_output_key --> ip_route_output_flow
> --> __ip_route_output_key --> ip_route_output_slow.
>
> In ip_route_output_slow, before fib_lookup, the iif is set to lookback
> device, not the real device where the packet comes.
This is expected behaviour. The RST packet is locally generated, and as
such has iif set to the loopback device.
> So the policy
> finding in fib_lookup will fail to find table 101 but fall to main
> table, so the oif is wan1 but not wan2.
There is one thing I don't understand. The RST packet is generated in
reply to a packet that was received on interface group2, so I would
expect that it sent back via that same interface, not on any wan
interface. Anyway, it does not matter what interface the original packet
was supposed to be forwarded to.
next prev parent reply other threads:[~2010-05-11 10:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-11 10:28 ipt_reject.c --> ip_route_me_harder ... --> ip_route_output_slow: iif is loopback device? s sg
2010-05-11 10:59 ` Pascal Hambourg [this message]
2010-05-11 14:45 ` Eason Su
2010-05-11 16:27 ` ratheesh k
2010-05-11 17:54 ` ratheesh k
2010-05-13 14:41 ` Eason Su
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=4BE9387A.8080806@plouf.fr.eu.org \
--to=pascal.mail@plouf.fr.eu.org \
--cc=netfilter@vger.kernel.org \
--cc=ssg2351@gmail.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