netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* VRF Routing Rule Matching Issue: oif Rules Not Working After Commit 40867d74c374
@ 2025-04-03  1:58 hanhuihui
  2025-04-07  8:29 ` Ido Schimmel
  0 siblings, 1 reply; 11+ messages in thread
From: hanhuihui @ 2025-04-03  1:58 UTC (permalink / raw)
  To: netdev@vger.kernel.org, dsahern@kernel.org, kuba@kernel.org

Dear Kernel Community and Network Maintainers,
I am analyzing the issue, and I am very happy for any replies.
After the application committed 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices"), we noticed an unexpected change in VRF routing rule matching behavior. We hereby submit a problem report to confirm whether this is the expected behavior.

Problem Description:
When interfaces bound to multiple VRFs share the same IP address, the OIF (output interface) routing rule is no longer matched after being committed. As a result, traffic incorrectly matches the low-priority rule.
Here are our configuration steps:
ip address add 11.47.3.130/16 dev enp4s0
ip address add 11.47.3.130/16 dev enp5s0

ip link add name vrf-srv-1 type vrf table 10
ip link set dev vrf-srv-1 up
ip link set dev enp4s0 master vrf-srv-1

ip link add name vrf-srv type vrf table 20
ip link set dev vrf-srv up
ip link set dev enp5s0 master vrf-srv

ip rule add from 11.47.3.130 oif vrf-srv-1 table 10 prio 0
ip rule add from 11.47.3.130 iif vrf-srv-1 table 10 prio 0
ip rule add from 11.47.3.130 table 20 prio 997


In this configuration, when the following commands are executed:
ip vrf exec vrf-srv-1 ping "11.47.9.250" -I 11.47.3.130
Expected behavior: The traffic should match the oif vrf-srv-1 rule of prio 0. Table 10 is used.
Actual behavior: The traffic skips the oif rule and matches the default rule of prio 997 (Table 20), causing the ping to fail.

Is this the expected behavior?
The submission description mentions "avoid oif reset of port devices". Does this change the matching logic of oif in VRF scenarios?
If this change is intentional, how should the VRF configuration be adjusted to ensure that oif rules are matched first? Is it necessary to introduce a new mechanism?

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-04-15 14:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03  1:58 VRF Routing Rule Matching Issue: oif Rules Not Working After Commit 40867d74c374 hanhuihui
2025-04-07  8:29 ` Ido Schimmel
2025-04-08 16:17   ` hanhuihui
2025-04-08 16:49     ` David Ahern
2025-04-08 19:54     ` Ido Schimmel
2025-04-12 13:17       ` hanhuihui
2025-04-12 13:19       ` [PATCH] resume oif rule match l3mdev in fib_lookup hanhuihui
2025-04-12 23:25         ` Jakub Kicinski
2025-04-14  7:17         ` Ido Schimmel
2025-04-14 17:24           ` Ido Schimmel
2025-04-15 14:11             ` hanhuihui

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).