Bug 297197 - fib handling of ipv6 via gif is broken / ipfw overwrites default route
Summary: fib handling of ipv6 via gif is broken / ipfw overwrites default route
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.4-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-07-31 12:07 UTC by sec
Modified: 2026-07-31 16:23 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sec 2026-07-31 12:07:53 UTC
My setup is:

re0: configured with IPv4 with 192.168.42.42/24 and an ipv6 ip via rtsol.

igb0: configured with static IP ($igb_v4) and a static v6 net ($igb_v6/64) and set to fib1
gif0: configured tunnel "tunnel $igb_v4 $remote link2 fib 1"


in fib1 i manually configure a default v4 route
route_gw2="default $router -fib 1"
and a default v6 route
ipv6_route_gw2="default -interface gif0 -fib 1"

ipfw table has an rule for v4:

setfib 1 ip from $igb_v4 to any

this works fine on v4. However v6 does not work, as packets sent to $igb_v6 are returned unencapsulated via re0 by default.

Generally I would have expected this to work without any fiddling with ipfw, but I'll gladly take pointers on what I did wrong.

If I add a corresponding ipfw rule
setfib 1 ip6 from $igb_v6 to any

routing for $igb_v6 works, but every packet that triggers that rule OVERWRITES the fib 0 ipv6 default route with the target ip.

For example:

   route to: ::
destination: ::
       mask: ::
    gateway: 2610:1c1:1:606c::19:2
        fib: 0
  interface: re0
      flags: <UP,GATEWAY,DONE,STATIC>
 recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
       0         0         0         0      1500         1         0 


This then breaks normal v6 networking on re0 / fib 0 completely.


I did try setting "tunnelfib 1" on gif0, but that seemed to have no effect with respect to routing.