From nobody Thu Jul 18 16:09:51 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 4WPyST0pdVz5Rg0H for ; Thu, 18 Jul 2024 16:10:01 +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 4WPySS6QRBz4L0s; Thu, 18 Jul 2024 16:10:00 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721319000; 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=gaUpuF8VhO2j/qXyMr1ljDgiRMxme/67Tb2OrtuABkE=; b=HTaTE9TnaN8bSXMGjBDAf3xRZk554Gna8fggXo4Hw+q3PV0ZU07UzPCYnhvP/0Jai4L1oo rEkT1TeiflbuO8S0dMEwtKYmyJwDRxCG0/Y9QuQJZfUBk53Bwnj0kpMGYzLKXBFqjY4bKh RlD7+GAGD8JjcFEiBj0D6hmC+IELLURBwO5g1EWhoqww1x/t9xXTRNB30/OJVhDFU4QP5V Al7JorjGMxSZy1TX7VTNkKqH4Th3cKsCDGU+wBBKlxgz92tJd0ewyUcMJTO6O6IrbwrueF gBAHMxPWmr3NhY6PJhUFHo0lGgBK4uhsHnYG555Dt2CdTzuDW1p1fdX5worJfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721319000; a=rsa-sha256; cv=none; b=MJK51Vam15GWCmd2v1xUzCDZxL18fwvz2bQz462vqPN/TCfbt77Dm+iOntg/3w1bnnZsmt fDgdweF6S+bAdAEqwy1az7dlP3e71hTYoovXAleFZwP2ZHYWPuEuGQuNO7zEQ4wYvJfykQ BAmoqfad4KD+C//KaVvjCNkFsIrN5nAO8ER12/mAjpN+c2xuMmThb9ikCf+EJZc2dMPq1J CGA7ybspfuOX6UG/Bcn69ORZ4f59AaoccO1ZZ4YbjyL+VryT/6g248gtmfrbkUvM7J42ln uoYaIjiue08ltQNH0tE6c0D5EOyK7H+9gOp3SdqP8yNTH2rzCfqsz5Uub/Y3tA== 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=1721319000; 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=gaUpuF8VhO2j/qXyMr1ljDgiRMxme/67Tb2OrtuABkE=; b=Vov/WOSirBtpZJMIY1J70QjYIoIIzD7y+T7rbvDXSO7aqU25vUKi11a7pw50i5Yjt8yVR4 6K+cBt36n/KxDrI9mEUkvixeJeeWXLldQDf5nxJywjU1uYTuph41EL+KJSLcQYbTsOj7md XJJAmi1mw5x8RftMJLAMBcOSXA8U4TZS84jY1xXMt6o8KN7mPPwWatqUus9t8Boc+OZY2C QeTZ2WXQar1vuvnIu+c7VE/+ge/by1dMgJfeRXT19e0OKbFGvQEyeV3T78JQJUot/CgefO AmWB1vgaysbTarCqJcskEqvk69M95FNVcQhOKv7GC6SWKZVfkOCsNS64unT46A== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (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 4WPySR5lKPzdNr; Thu, 18 Jul 2024 16:09:59 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_D218F227-362B-461E-B658-BA5165D0EFE0" 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:09:51 +0800 In-Reply-To: Cc: "freebsd-net@freebsd.org" To: Santiago Martinez References: X-Mailer: Apple Mail (2.3696.120.41.1.8) --Apple-Mail=_D218F227-362B-461E-B658-BA5165D0EFE0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > 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) 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. =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. ``` # 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. >=20 > Santiago >=20 >=20 --Apple-Mail=_D218F227-362B-461E-B658-BA5165D0EFE0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

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

=20 =20

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=_D218F227-362B-461E-B658-BA5165D0EFE0--