Bug 266544 - Cannot send to static ipv6 interface routes
Summary: Cannot send to static ipv6 interface routes
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.3-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-22 06:49 UTC by Sam Frenick
Modified: 2022-09-24 01:53 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Frenick 2022-09-22 06:49:08 UTC
Hello,

Consider a static IPv6 deployment where there are multiple prefixes on the link. FreeBSD is configured with an ipv6 address on one of those prefixes, but the other prefix must be reached via a static route. There are no router advertisements on the link.


Problem:
Traffic flows to the prefix for which the host has an address, but does not flow to the prefix via the static route.

To Reproduce:
1) Install FreeBSD-12.3-RELEASE. I used the FreeBSD-12.3 VMDK VMware image and logged in as root.

2) Configure the interface without specifying accept_rtad:
# ifconfig em0 inet6 2001:db8:1::1/64

3) Observe ping6 2001:db8:1::1 works

4) Add static route to another prefix on the link:
# route -6 add -net 2001:db8:2::/64 -iface em0

5) Observe pinging any host on 2001:db8:2::/64 does not work and produces the following error:

ping6: sendmsg: No buffer space available
ping6: wrote 2001:db8:2::2 16 chars, ret=-1
Comment 1 Magnus Kaiser 2022-09-22 07:28:45 UTC
Hi,

I don't think that's supposed to work in the first place. Without having an address of the same prefix you try to reach you would need a first hop through some router. Multiple prefixes, even when on the same L2 link, are considered separate logical networks and you need some point to connect those logically too. Either by having an IP of that network configured yourself, or by using a router that connects to those networks.

Is there a specific reason why multiple prefixes exists on one L2 link without using RAs? Any specific reason why using an IP of the other prefix is no alternative to static routes?
Comment 2 Sam Frenick 2022-09-23 09:07:24 UTC
I am trying to have FreeBSD certified for use in our envionmnet. There are sound reasons behind the network architecture and suffice to say that it is not in my power to change the network environment. Either the officially supported FreeBSD release meets the requirements or we cannot use it.

Your suggestion of using a L3 router as a gateway will not work because the gateway simply sends an rediect informing FreeBSD that the desination is on link, however FreeBSD ignores the redirect (likely due to this bug).

Please note:
1) The Linux kernel works fine in this environment;

2) This bug is either related to or a duplicate of bug 233283 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233283

3) This bug (and perhaps 233283) is resolved in the following commit into main https://github.com/freebsd/freebsd-src/commit/f998535a66b986f51dd65b5153d1a580d50ddfbe

Given that the issues is resolved in main, I would be most grateful for this to be backported into 12-STABLE and 13-STABLE for inclusion into 12.4-RELEASE and 13.2-RELEASE.