Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Aug 2025 16:00:29 +0100
From:      Lexi Winter <ivy@freebsd.org>
To:        Felix <felix@ffetc.net>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Source address selection failure when using RFC5549-style (v4-via-v6) routes
Message-ID:  <aJIcjevipmXYALTh@freefall.freebsd.org>
In-Reply-To: <c3eefb7e-ea67-485a-83b8-d095b5847eef@ffetc.net>
References:  <c3eefb7e-ea67-485a-83b8-d095b5847eef@ffetc.net>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Felix:
> I've been experimenting a bit with routing IPv4 via IPv6 next-hops,
>[...]
> What I've discovered: trying to /originate/ a connection from a machine with
> such a route doesn't seem to work properly.

you can fix this by assigning your IPv4 loopback address to every
interface with such a route:

	ifconfig ix0 inet 192.168.0.1/32
	ifconfig ix1 inet 192.168.0.1/32
	ifconfig ix2 inet 192.168.0.1/32
	...

after doing that, you need to re-install any routes via these interfaces
to pick up the new source address.

> I'm not sure what the right thing for FreeBSD to do in this circumstance is.
> What do you think?

i prefer the Linux behaviour.  however, when i've raised this in the
past it seems like this opinion is far from universal.  as this matches
historical behaviour for legacy IP and there is a workaround, i'm not
sure it's important enough to fix.

> I also haven't tested whether this same issue affects the generation of ICMP
> responses (e.g. TTL expired, packet too big). If it does, that seems like
> much more of a concern for using FreeBSD on real routers.

it does.  the host will send ICMP errors from 0.0.0.0 unless you apply
the workaround above.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCaJIciQAKCRD1nT63mIK/
YJq/AP9Yslk98rNbA6HEVa99KHNA//RRv4l14TYsHIzNKhwUrAEA6mql+Dqinkku
uUBTPcmgHm4cfO0jdXrI+1j6OZ1iOQM=
=6kOE
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?aJIcjevipmXYALTh>