From nobody Thu Jul 18 16:15:12 2024 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WPyZb6dG4z5RgL5 for ; Thu, 18 Jul 2024 16:15:19 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WPyZb67Q2z4MJN; Thu, 18 Jul 2024 16:15:19 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721319319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sNjm+Rjv/6mnmd39H4MZC4WkZts2D959+JqVxhl9ki0=; b=AJJ/YeD11jopG1AWnE57iLOAEgznwuoyZwYSgBJLYpuowzrlJtFPLoKdgWX/BNO5z9N1Lm NgtkFv+QvDSDviOgPUz3i3S0y/UHr3CIsHrsGZFbnAuirnOApCZlpkRce4YO/pYMVWlb9/ c9Z038YMo5lAN0jA+C4waymB0HfzP4FtxTtTa5tZtXdhDHaLdspYgy74FQph3kzXz6fstU e7XM+Mhcf3ttA1eoaT96xC7ueMvRw+cEMPoiH7bnR3S6dVam277qwG7xXJman7ogLh5yQY YuAxJJ3kHd9iaLn/WTiceyG8ylRCSJkWWKUdVaaZxpedZWSfM/qVbgHq3J6wvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721319319; a=rsa-sha256; cv=none; b=WJ4a0P/GbyuGSo4sj9EY6JMUeucEJ44r3QiYO8oqR2U2eWhwQFc9p3Q/4AkgMbbubdxLxC uIBs5QITcaiylBQbndShH2+S4wTmP/xMMhKcj5/7Ft0YCoUNSaIG1KMqA5KBit6HnFGi0d sglY8B111S9z7K0XZrEgBDjDRYvt0KUfDne9iqFMbwWT/ke9B+S7I9TF05gxuvo4Qm6isx qiEF7BBOakOm0Fkj01+/4wkPdPR06v7jq1foluH87exbJbnJiQ9+655QV9YkONRzsPksBR CrO4hp/JChSTxBwdzeTGyjSFVNNk+n0wlf3zqt4lTaxT/8gnT8l2XoGEV8TCRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721319319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sNjm+Rjv/6mnmd39H4MZC4WkZts2D959+JqVxhl9ki0=; b=S+rwKQhtAQBp9OrTVizr7DXmJSCQsseeXVKtToqrWxFwj4phXxkpVYfmq2wXBjlMIgE0Gj 0jrlj6X/ZchH10Js1mSROnriEe+vVus09i4X9httQa7TEBl/GN0KcA432sTS10ysBp92GO t7q2yYyLj2iEOQ1jL8Lm+IrKYoEBz3WBwQAHjzs35ydLnmTJCzNXCOOUHeGEawy3qfXGgU 0ii/0rYvE7fsfm94lMVpxr46l3lHviMru+tcYGIS5EFk3QuO6DsG3N8OWWpVLpa8M+X/xN Vv2UGKJo+Zco3wnRj72xeam237ne27cuqX3A4W0J+4vjiMnggPvtJWL4TxrQIQ== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WPyZZ5KXWzd9l; Thu, 18 Jul 2024 16:15:18 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_C338E674-F01E-4A6C-8A76-67DBE390042A" List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: Multiple Fibs and INET6 Date: Fri, 19 Jul 2024 00:15:12 +0800 In-Reply-To: <70305bf3-cfe4-4cdd-8cb8-c03c1a9c2b8f@codenetworks.net> Cc: freebsd-net@freebsd.org To: Santiago Martinez References: <70305bf3-cfe4-4cdd-8cb8-c03c1a9c2b8f@codenetworks.net> X-Mailer: Apple Mail (2.3696.120.41.1.8) --Apple-Mail=_C338E674-F01E-4A6C-8A76-67DBE390042A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jul 19, 2024, at 12:11 AM, Santiago Martinez = wrote: >=20 > Interesting, I'm running 14.1p2. >=20 >=20 Yes, I'm running exactly the same version with you. > how does your routing table looks for fib1 ? >=20 >=20 ``` # netstat -6rnF 1 Routing tables (fib: 1) Internet6: Destination Gateway Flags = Netif Expire fe80::%lo1/64 link#5 U = lo1 fe80::1%lo0 link#2 UHS = lo0 ``` > Santi >=20 >=20 >=20 > On 7/18/24 18:09, Zhenlei Huang wrote: >>=20 >>=20 >>> On Jul 13, 2024, at 1:06 AM, Santiago Martinez > wrote: >>>=20 >>> Hi Everyone. >>>=20 >>> While adding -F ( fib as used in netstat ) to ping and ping6 I have = found something that from my understanding is not correct. >>> Please can you advise? >>> I have the following setup : >>>=20 >>> -- two fibs (0 and 1)=20 >>> -- two loop-backs (lo0 and lo1). >>> -- Lo1 has been assigned to fib1 >>> -- net.add_addr_allfibs =3D 0 >>> My interface output looks like this: >>>=20 >>>=20 >>> ifconfig lo0 | grep inet6=20 >>> inet6 ::1 prefixlen 128=20 >>> inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2=20 >>>=20 >>> ifconfig lo1 | grep inet6=20 >>> inet6 fe80::1%lo1 prefixlen 64 scopeid 0x3 >>>=20 >>>=20 >>> If I do a netstat -rn -6 -F0 I get the following which is was i = expected. >>>=20 >>> Internet6:=20 >>> Destination Gateway = Flags Netif Expire=20 >>> ::/96 link#2 URS = lo0=20 >>> ::1 link#2 UHS = lo0=20 >>> ::ffff:0.0.0.0/96 link#2 URS = lo0=20 >>> fe80::%lo0/10 link#2 URS = lo0=20 >>> fe80::%lo0/64 link#2 U = lo0=20 >>> fe80::1%lo0 link#2 UHS = lo0=20 >>> ff02::/16 link#2 URS = lo0 >>>=20 >>>=20 >>> Now, netstat -rn -6 -F1 shows "fe80::1%lo0" which should not be = there and "fe80::1%lo1" is missing which should be there. >>>=20 >>> Internet6:=20 >>> Destination Gateway = Flags Netif Expire=20 >>> fe80::%lo1/64 link#3 U = lo1=20 >>> fe80::1%lo0 link#2 UHS = lo0 >>>=20 >> That seems wrong from my first glance. IIRC, there's HACK ( I'd = prefer this ) for loopback route. For example >> ``` >> # sysctl net.fibs=3D3 >> net.fibs: 2 -> 3 >> # ifconfig epair create >> # epair0a >> # ifconfig epair0a fib 2 >> # ifconfig epair0a inet6 -ifdisabled up >> # netstat -6rnF 2 >> Routing tables (fib: 2) >>=20 >> Internet6: >> Destination Gateway Flags = Netif Expire >> fe80::%epair0a/64 link#5 U = epair0a >> fe80::3b:b3ff:fe8f:9a0a%lo0 link#1 UHS = lo0 >> ``` >>=20 >> The loopback route always refer the first loop interface, aka lo0. =20= >>>=20 >>>=20 >>> What output I was expecting was: >>> Internet6:=20 >>> Destination Gateway = Flags Netif Expire=20 >>> fe80::%lo1/64 link#3 U = lo1=20 >>> fe80::1%lo1 link#3 UHS = lo1 >>>=20 >>>=20 >>>=20 >>> This makes the ping -6 -F0 fe80::1%lo0 to work but ping -6 -F1 = fe80::1%l01 to fail which I wanted to use as test case. >>>=20 >> That is interesting. I can ping without failure. >>=20 >> ``` >> # setfib 1 ping6 -c3 fe80::1%lo1 >> PING(56=3D40+8+8 bytes) fe80::1%lo1 --> fe80::1%lo1 >> 16 bytes from fe80::1%lo1, icmp_seq=3D0 hlim=3D64 time=3D0.050 ms >> 16 bytes from fe80::1%lo1, icmp_seq=3D1 hlim=3D64 time=3D0.067 ms >> 16 bytes from fe80::1%lo1, icmp_seq=3D2 hlim=3D64 time=3D0.096 ms >>=20 >> --- fe80::1%lo1 ping statistics --- >> 3 packets transmitted, 3 packets received, 0.0% packet loss >> round-trip min/avg/max/stddev =3D 0.050/0.071/0.096/0.019 ms >> ``` >>=20 >> Best regards, >> Zhenlei >>=20 >>>=20 >>> Thanks in advance. >>>=20 >>> Santiago >>>=20 >>>=20 >>=20 >>=20 >>=20 --Apple-Mail=_C338E674-F01E-4A6C-8A76-67DBE390042A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Jul 19, 2024, at 12:11 AM, Santiago Martinez <sm@codenetworks.net>= wrote:

=20 =20

Interesting, I'm running 14.1p2.



Yes, I'm running exactly the same version with you.

how does your routing table looks for fib1 = ?



```
# netstat -6rnF 1
Routing = tables (fib: 1)

Internet6:
Destination     =                   Gateway =                     =   Flags     Netif Expire
fe80::%lo1/64   =                   link#5 =                     =    U           = lo1
fe80::1%lo0             =           link#2         =                UHS     =     lo0
```

Santi


On 7/18/24 18:09, Zhenlei Huang = wrote:


On Jul 13, 2024, at 1:06 AM, Santiago Martinez <sm@codenetworks.net> wrote:

Hi Everyone.

While adding -F ( fib as used in netstat ) to ping and ping6 I have found something that from my understanding is not correct.
Please can you advise?

I have = the following setup :

-- two fibs (0 and 1) 
-- two  loop-backs (lo0 and lo1).
-- Lo1 has been assigned to fib1
-- net.add_addr_allfibs =3D 0

My interface output looks like this:


ifconfig lo0 | grep inet6
       inet6 ::1 = prefixlen 128
       inet6 = fe80::1%lo0 prefixlen 64 scopeid 0x2

ifconfig lo1 | grep inet6
       inet6 = fe80::1%lo1 prefixlen 64 scopeid 0x3

If I do a netstat -rn -6  = -F0 I get the following which is was i expected.

Internet6:
Destination =             &n= bsp;         Gateway =             &n= bsp;         Flags =     Netif Expire
::/96 =             &n= bsp;           &nbs= p;   link#2 =             &n= bsp;          URS =         lo0
::1 =             &n= bsp;           &nbs= p;     link#2 =             &n= bsp;          UHS =         lo0
::ffff:0.0.0.0/96 =             &n= bsp;   link#2 =             &n= bsp;          URS =         lo0
fe80::%lo0/10 =             &n= bsp;       link#2 =             &n= bsp;          URS =         lo0
fe80::%lo0/64 =             &n= bsp;       link#2 =             &n= bsp;          U =           lo0
fe80::1%lo0 =             &n= bsp;         link#2 =             &n= bsp;          UHS =         lo0
ff02::/16 =             &n= bsp;           link= #2 =             &n= bsp;          URS =         lo0

Now,  netstat -rn -6  -F1 shows  = "fe80::1%lo0" which should not be there and "fe80::1%lo1" is missing which should be there.

Internet6:
Destination =             &n= bsp;         Gateway =             &n= bsp;         Flags =     Netif Expire
fe80::%lo1/64 =             &n= bsp;       link#3 =             &n= bsp;          U =           lo1
fe80::1%lo0 =             &n= bsp;         link#2 =             &n= bsp;          UHS =         lo0

That seems wrong from my first glance. IIRC, there's HACK ( I'd prefer this ) for loopback route. For example
```
# sysctl net.fibs=3D3
net.fibs: 2 -> 3
# ifconfig epair create
epair0a
# ifconfig epair0a fib 2
# ifconfig epair0a inet6 -ifdisabled up
# netstat -6rnF 2
Routing tables (fib: 2)

Internet6:
Destination                   =     Gateway               =         Flags     Netif Expire
fe80::%epair0a/64                 = link#5                   =      U       epair0a
fe80::3b:b3ff:fe8f:9a0a%lo0       link#1         =                UHS     =     lo0
```

The loopback route always refer the first loop = interface, aka lo0.  


What output I was expecting was:

Internet6:
Destination =             &n= bsp;         Gateway =             &n= bsp;         Flags =     Netif Expire
fe80::%lo1/64 =             &n= bsp;       link#3 =             &n= bsp;          U =           lo1
fe80::1%lo1 =             &n= bsp;         link#3 =             &n= bsp;          UHS =         lo1


This makes the ping -6 -F0 = fe80::1%lo0  to work but ping -6 -F1 fe80::1%l01 to fail which I wanted to use as test case.

That is interesting. I can ping without = failure.

```
# setfib 1 ping6 -c3 fe80::1%lo1
PING(56=3D40+8+8 bytes) fe80::1%lo1 --> = fe80::1%lo1
16 bytes from fe80::1%lo1, icmp_seq=3D0 = hlim=3D64 time=3D0.050 ms
16 bytes from fe80::1%lo1, icmp_seq=3D1 = hlim=3D64 time=3D0.067 ms
16 bytes from fe80::1%lo1, icmp_seq=3D2 = hlim=3D64 time=3D0.096 ms

--- fe80::1%lo1 ping statistics ---
3 packets transmitted, 3 packets received, = 0.0% packet loss
round-trip min/avg/max/stddev =3D = 0.050/0.071/0.096/0.019 ms
```

Best regards,
Zhenlei


Thanks in advance.

Santiago








= --Apple-Mail=_C338E674-F01E-4A6C-8A76-67DBE390042A--