From nobody Fri Jul 30 08:45:01 2021 X-Original-To: bugs@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 CF0B212DAFA3 for ; Fri, 30 Jul 2021 08:45:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GbgvK5N5Sz4RMn for ; Fri, 30 Jul 2021 08:45:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D21A21E49 for ; Fri, 30 Jul 2021 08:45:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 16U8j1gt099578 for ; Fri, 30 Jul 2021 08:45:01 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 16U8j1ph099577 for bugs@FreeBSD.org; Fri, 30 Jul 2021 08:45:01 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 257499] IPv6 link routes are not removed from routing table when interface goes down Date: Fri, 30 Jul 2021 08:45:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: alexis.savin@efficientip.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D257499 Bug ID: 257499 Summary: IPv6 link routes are not removed from routing table when interface goes down Product: Base System Version: 13.0-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: alexis.savin@efficientip.com Hello FreeBSD community, I'm facing some kind of inconsistent behavior with the kernel's IPv6 implementation. Directly Connected routes (link routes) are consistently created at startup= or when an network interface is created. However, these routes remain in the routing table when associated network interface goes down. If then deleted (manually or by a specific process such as quagga), these routes are not restored in the routing table when the interface goes back u= p, leading to unexpected behavior. Tested on 11.4-STABLE and 13.0-STABLE. Step to Reproduce: 1. Configure an additional network interface on a FreeBSD device with IPv6 = and get it up and running (connected + up) ``` ifconfig_em1=3D"up media autoselect -txcsum" ifconfig_em1_alias0=3D"inet 10.10.10.24 netmask 255.255.255.0" ifconfig_em1_ipv6=3D"inet6 2607:5300:203:2e61::2 prefixlen 64" ``` 2. Observe that interface is up and that link routes are pushed into the routing table (both IPv4 and IPv6) ``` # ifconfig em1 em1: flags=3D8843 metric 0 mtu 1500 options=3D98 ether 08:00:27:57:85:9f hwaddr 08:00:27:57:85:9f inet6 fe80::a00:27ff:fe57:859f%em1 prefixlen 64 scopeid 0x2 inet6 2607:5300:203:2e61::2 prefixlen 64 inet 10.10.10.24 netmask 0xffffff00 broadcast 10.10.10.255 nd6 options=3D21 media: Ethernet autoselect (1000baseT ) status: active # netstat -rn4 Routing tables Internet: Destination Gateway Flags Netif Expire default 192.168.1.254 UGS em0 10.10.10.0/24 link#2 U em1 10.10.10.24 link#2 UHS lo0 127.0.0.1 link#3 UH lo0 192.168.1.0/24 link#1 U em0 192.168.1.18 link#1 UHS lo0 # netstat -rn6 Routing tables Internet6: Destination Gateway Flags N= etif Expire ::/96 ::1 UGRS = lo0 ::1 link#3 UHS = lo0 ::ffff:0.0.0.0/96 ::1 UGRS = lo0 2607:5300:203:2e61::/64 link#2 U = em1 2607:5300:203:2e61::2 link#2 UHS = lo0 fe80::/10 ::1 UGRS = lo0 fe80::%em1/64 link#2 U = em1 fe80::a00:27ff:fe57:859f%em1 link#2 UHS = lo0 fe80::%lo0/64 link#3 U = lo0 fe80::1%lo0 link#3 UHS = lo0 ff02::/16 ::1 UGRS = lo0 ``` 3. Take down the interface em1 and observe that IPv4 link routes (10.10.10.0/24) are removed from the routing table while IPv6 link routes (2607:5300:203:2e61::/64, 2607:5300:203:2e61::2 and fe80::%em1/64) remain. ``` # ifconfig em1 down # ifconfig em1=20 em1: flags=3D8802 metric 0 mtu 1500 options=3D98 ether 08:00:27:57:85:9f hwaddr 08:00:27:57:85:9f inet6 fe80::a00:27ff:fe57:859f%em1 prefixlen 64 tentative scopeid 0= x2 inet6 2607:5300:203:2e61::2 prefixlen 64 tentative inet 10.10.10.24 netmask 0xffffff00 broadcast 10.10.10.255 nd6 options=3D21 media: Ethernet autoselect (1000baseT ) status: active # netstat -rn4 Routing tables Internet: Destination Gateway Flags Netif Expire default 192.168.1.254 UGS em0 10.10.10.24 link#2 UHS lo0 127.0.0.1 link#3 UH lo0 192.168.1.0/24 link#1 U em0 192.168.1.18 link#1 UHS lo0 # netstat -rn6 Routing tables Internet6: Destination Gateway Flags N= etif Expire ::/96 ::1 UGRS = lo0 ::1 link#3 UHS = lo0 ::ffff:0.0.0.0/96 ::1 UGRS = lo0 2607:5300:203:2e61::/64 link#2 U = em1 2607:5300:203:2e61::2 link#2 UHS = lo0 fe80::/10 ::1 UGRS = lo0 fe80::%em1/64 link#2 U = em1 fe80::a00:27ff:fe57:859f%em1 link#2 UHS = lo0 fe80::%lo0/64 link#3 U = lo0 fe80::1%lo0 link#3 UHS = lo0 ff02::/16 ::1 UGRS = lo0 ``` 4. Delete remaining routes ``` route delete -inet6 fe80::%em1/64 route delete -inet6 2607:5300:203:2e61::2 route delete -inet6 2607:5300:203:2e61::/64 # netstat -rn6 Routing tables Internet6: Destination Gateway Flags N= etif Expire ::/96 ::1 UGRS = lo0 ::1 link#3 UHS = lo0 ::ffff:0.0.0.0/96 ::1 UGRS = lo0 fe80::/10 ::1 UGRS = lo0 fe80::a00:27ff:fe57:859f%em1 link#2 UHS = lo0 fe80::%lo0/64 link#3 U = lo0 fe80::1%lo0 link#3 UHS = lo0 ff02::/16 ::1 UGRS = lo0 ``` # Bring the interface back up, observer that link routes are not restored ``` # ifconfig em1 up # ifconfig em1=20 em1: flags=3D8843 metric 0 mtu 1500 options=3D98 ether 08:00:27:57:85:9f hwaddr 08:00:27:57:85:9f inet6 fe80::a00:27ff:fe57:859f%em1 prefixlen 64 scopeid 0x2 inet6 2607:5300:203:2e61::2 prefixlen 64 inet 10.10.10.24 netmask 0xffffff00 broadcast 10.10.10.255 nd6 options=3D21 media: Ethernet autoselect (1000baseT ) status: active # netstat -rn6 Routing tables Internet6: Destination Gateway Flags N= etif Expire ::/96 ::1 UGRS = lo0 ::1 link#3 UHS = lo0 ::ffff:0.0.0.0/96 ::1 UGRS = lo0 fe80::/10 ::1 UGRS = lo0 fe80::a00:27ff:fe57:859f%em1 link#2 UHS = lo0 fe80::%lo0/64 link#3 U = lo0 fe80::1%lo0 link#3 UHS = lo0 ff02::/16 ::1 UGRS = lo0 ``` From my understanding, this is definitely not the expected behavior. It's not consistent regarding FreeBSD IPv4 implementation, nor consistant regarding other kernel implementation. On Linux for instance, these link routes are taken down when network interf= ace goes down and brough back once back up. So unless I'm missing some specific configuration setting, I suspect an iss= ue with the IPv6 network stack. I guess this doesn't affect everybody, we figured it out while using dynamic routing (Quagga/FRR +BGP). Thank in advance for your feedback Kind regards --=20 You are receiving this mail because: You are the assignee for the bug.=