FreeBSD 13.2-RELEASE-p1 releng/13.2-n254621-08b87f63a046 GENERIC amd64 Setup: I route a public IP-network via gre tunnel. For diagnostic reasons I switched routing over a second tunnel, this failed to work. Diagnostics: # route get 192.0.2.128/25 route to: 192.0.2.128 destination: 192.0.2.128 mask: 255.255.255.128 fib: 0 interface: gre1 flags: <UP,DONE,STATIC> recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1476 1 0 # route change 192.0.2.128/25 -interface gre2 change net 192.0.2.128: gateway gre2 fib 0 # route get 192.0.2.128/25 route to: 192.0.2.128 destination: 192.0.2.128 mask: 255.255.255.128 fib: 0 interface: gre1 flags: <UP,DONE,STATIC> recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1476 1 0 Note this still shows "gre1" not "gre2" The effective route is not changed as the output of route told above. Workaround: # route del 192.0.2.128/25 del net 192.0.2.128 fib 0 # route add 192.0.2.128/25 -interface gre2 add net 192.0.2.128: gateway gre2 fib 0 # route get 192.0.2.128/25 route to: 192.0.2.128 destination: 192.0.2.128 mask: 255.255.255.128 fib: 0 interface: gre2 flags: <UP,DONE,STATIC> recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1476 1 0
^Triage (hat on): * status * assignee, probably net@ * avoid [tags] in summary lines <https://wiki.freebsd.org/Bugzilla/DosAndDonts#tags> (please, do not …) ---- Hat off: I'll follow this report with interest. <https://man.freebsd.org/cgi/man.cgi?query=route&sektion=8&manpath=freebsd-release>
Note, I don't think -interface is the keyword that you want here; it means that no gateway is used. From route(8): "If the destination is directly reachable via an interface requiring no intermediary system to act as a gateway, the -interface modifier should be specified; the gateway given is the address of this host on the common network, indicating the interface to be used for transmission. Alternately, if the interface is point to point the name of the interface itself may be given," In this case, the tunnel ignores the first-hop destination address, so this works by accident. The -ifp modifier is intended for this usage, but is currently broken.