Re: [PATCH net-next 1/2] seg6: add FIB table attribute for post-encap SID route lookup
From: David Ahern
Date: Sat Jul 11 2026 - 13:04:17 EST
On 7/11/26 10:29 AM, Andrea Mayer wrote:
> After SRv6 encapsulation the kernel looks up the route for the first SID,
> that is the outer IPv6 destination of the encapsulated packet. This
> post-encap SID route lookup uses the FIB table of the current routing
> context. When the encap route is installed in a VRF, the VRF's table may
> not have a route matching the SID. In that case another table should
> handle it, e.g. one configured for underlay connectivity.
>
> Add an optional SEG6_IPTUNNEL_TABLE attribute that selects the FIB table
> used for this lookup. When set by the user, the attribute is honored on
> both the input path (forwarded traffic) and the output path (locally
> originated traffic). SRv6 encap routes that do not set the attribute use
> the current routing context, as before.
>
> For example:
>
> # SID route installed in the underlay table 500
> ip -6 route add fc00::100/128 via fd00::1 dev veth0 table 500
>
> # encap route in vrf-100; the first SID is looked up in table 500
> ip -6 route add cafe::1/128 vrf vrf-100 \
> encap seg6 mode encap segs fc00::100 lookup 500 dev veth0
>
> # or look up the SID in the main table
> ip -6 route add cafe::1/128 vrf vrf-100 \
> encap seg6 mode encap segs fc00::100 lookup main dev veth0
>
> Suggested-by: Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx>
> Signed-off-by: Andrea Mayer <andrea.mayer@xxxxxxxxxxx>
> Reviewed-by: Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx>
> ---
> include/uapi/linux/seg6_iptunnel.h | 1 +
> net/ipv6/seg6_iptunnel.c | 132 +++++++++++++++++++++++++----
> 2 files changed, 117 insertions(+), 16 deletions(-)
>
Acked-by: David Ahern <dsahern@xxxxxxxxxx>