Re: FreeBSD 14.x localhost source address

From: Michael Proto <mike_at_jellydonut.org>
Date: Mon, 01 Jul 2024 23:16:07 UTC
On Mon, Jul 1, 2024 at 7:04 PM Craig Leres <leres@freebsd.org> wrote:
>
> On 7/1/24 15:53, Michael Proto wrote:
> >   What netmask are you using for 127.0.0.2? I'd treat it as I would an
> > IP alias (only on localhost) with a /32 netmask, should keep it
> > isolated. Just tried it myself on a test box and iperf works as
> > expected, using 127.0.0.1 as the source when connecting.
>
> I was just looking at that and I used 127.0.0.2 without an explicit mask
> and the system picked /24. I'm not sure why I did it that way but it's
> been awhile.
>
> I just got rid of lo2 and made 127.0.0.2/32 an alias on lo0 and it seems
> to work better all around.
>
> I guess the overlap between 127.0.0.0/8 and 127.0.0.0/24 was problematic.
>
>                 Craig

Yep, most network stacks I'm familiar with will pick the more-specific
route when given two options like that, hence the use of 127.0.0.2 as
the source. Glad its working now.


-Proto