From owner-freebsd-net@freebsd.org Mon Jul 6 20:58:59 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC797348B44 for ; Mon, 6 Jul 2020 20:58:59 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0ybl3N1Qz4YNp for ; Mon, 6 Jul 2020 20:58:59 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: by mailman.nyi.freebsd.org (Postfix) id 73B0F348B43; Mon, 6 Jul 2020 20:58:59 +0000 (UTC) Delivered-To: net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 737E33489EA for ; Mon, 6 Jul 2020 20:58:59 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B0ybk3QHwz4Ykx for ; Mon, 6 Jul 2020 20:58:58 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 4B0ybh2MRMz3mWM for ; Mon, 6 Jul 2020 20:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=daemonic.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:references:from:from:subject:subject:received :received; s=20151023; t=1594069135; bh=Xa5l1JUj8o0MYFz1CWBFWgpM YSkE2na4IyDIVurbb5c=; b=JuW7osMu34p3Croug/viOk+ylA5ZIKRUbSJsmfoo 8zYeT1BmDSV+lP+S+iwcYLYq/zBHJkoey1yv7h0pvfergw2hK1a9/lgptpQLjpq+ 5Kn0hBzrdNDa+5vP6yD4/pheKxfZsEWHTdEfKG0GEA0eeSOeeMMzmNlu8Iyiub3Y q0g= X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id cr0VlgeouPSo for ; Mon, 6 Jul 2020 20:58:55 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:e911:95b5:705c:34b7]) by mail.daemonic.se (Postfix) with ESMTPSA id 4B0ybg2NwPz3mMv for ; Mon, 6 Jul 2020 20:58:55 +0000 (UTC) Subject: Re: Specifying link-local address in rc.conf From: Niclas Zeising To: net@FreeBSD.org References: <713e1f3e-4dd9-8dcf-c6d2-15c684bdce5b@daemonic.se> Message-ID: Date: Mon, 6 Jul 2020 22:58:54 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <713e1f3e-4dd9-8dcf-c6d2-15c684bdce5b@daemonic.se> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4B0ybk3QHwz4Ykx X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=daemonic.se header.s=20151023 header.b=JuW7osMu; dmarc=pass (policy=none) header.from=daemonic.se; spf=pass (mx1.freebsd.org: domain of zeising@daemonic.se designates 176.58.89.161 as permitted sender) smtp.mailfrom=zeising@daemonic.se X-Spamd-Result: default: False [-3.47 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[daemonic.se:s=20151023]; NEURAL_HAM_MEDIUM(-1.01)[-1.011]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[net@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.02)[-1.024]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[daemonic.se:+]; DMARC_POLICY_ALLOW(-0.50)[daemonic.se,none]; NEURAL_HAM_SHORT(-0.43)[-0.434]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:36236, ipnet:176.58.89.0/24, country:US]; TAGGED_FROM(0.00)[freebsd]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2020 20:58:59 -0000 On 2020-07-06 13:05, Niclas Zeising wrote: > Hi! > Is it possible to specify a link-local address in rc.conf, and get only= =20 > that link-local address? >=20 > When I add a specific link-local address, such as fe80::1/64, to an=20 > interface from the command line, and then add a global uincast address,= =20 > it works as expected, I do not get an additional link-local address. > When I try to do the same in rc.conf however, it does not work. > I have added the following: > ifconfig_vtnet0_inet6=3D"inet6 fe80::1/64" > ifconfig_vtnet0_alias0=3D"2001:6b8::1/64" > to rc.conf, but when restarting, I get both fe80::1 and a EUI64-based=20 > link-local address assigned to the interface.=C2=A0 It does not matter = which=20 > order I specify the entries in rc.conf. > I have tried changing the sysctl net.inet6.ip6.auto_linklocal to 0 in=20 > /etc/sysctl.conf, but that does not work (it seems it takes effect too=20 > late, the interface still has the AUTO_LINKLOCAL flag set according to=20 > ifconfig). > I tried adding -auto_linklocal to the ifconfig_* lines in /etc/rc.conf,= =20 > and while this removes the AUTO_LINKLOCAL flag from the interface, a=20 > EUI64 based link-local address is still assigned to the interface. >=20 > While there might not be much of a problem having mulitple link-local=20 > addresses, this is surprising.=C2=A0 Adding a specific link-local addre= ss to=20 > an interface, even from rc.conf, shouldn't mean that the EUI64-one is=20 > created.=C2=A0 Perhaps something like ifconfig_IF_linklocal=3D"" should= be=20 > added, or this is a bug in rc.network.=C2=A0 I tried looking through=20 > rc.network and related rc files, but I didn't find anything obvious, an= d=20 > I couldn't really figure out how addresses are added to interfaces=20 > during boot. >=20 > This is causing issues when I want for instance rtadvd to use the=20 > fe80::1/64 address as source for router advertisements, since it picks=20 > the EUI64 link-local address as source (which means this also ends up i= n=20 > client routing tables as the default gateway).=C2=A0 I can work around = this=20 > problem by adding fe80::1/64 with prefer_source, but I would prefer if=20 > there only was one link-local address on an interface. >=20 > All of this is on FreeBSD 12.1. >=20 > Perhaps I'm just missing something, but this behavior feels a little=20 > surprising. >=20 > I can share more detailed configuration, and perhaps the whole virtual=20 > machine I'm testing on, if needed. >=20 > Regards I did some more digging. It only happens when there's also an=20 ifconfig_IF for IPv4 in the /etc/rc.conf. Not working configuration (/etc/rc.conf) ifconfig_vtnet0=3D"192.168.0.1/24" ifconfig_vtnet0_ipv6=3D"inet6 fe80::1/64" ifconfig_vtnet0_alias0=3D"inet6 2001:6b8::/64" This configuration creates an EUI64-based link-local addess on vtnet0 as=20 well. Working configuration (apart from no IPv4) ifconfig_vtnet0_ipv6=3D"inet6 fe80::1/64" ifconfig_vtnet0_alias0=3D"inet6 2001:6b8::/64" Regards --=20 Niclas