From owner-freebsd-net@freebsd.org Tue Jul 7 15:10:38 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 A62CC364C96 for ; Tue, 7 Jul 2020 15:10:38 +0000 (UTC) (envelope-from freebsd@grem.de) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1QqL1Sxjz3Slb for ; Tue, 7 Jul 2020 15:10:38 +0000 (UTC) (envelope-from freebsd@grem.de) Received: by mailman.nyi.freebsd.org (Postfix) id 308FE364C95; Tue, 7 Jul 2020 15:10:38 +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 30545364D00 for ; Tue, 7 Jul 2020 15:10:38 +0000 (UTC) (envelope-from freebsd@grem.de) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (Client CN "mail.evolve.de", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1QqH02Qpz3SYV for ; Tue, 7 Jul 2020 15:10:34 +0000 (UTC) (envelope-from freebsd@grem.de) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id ea524557; Tue, 7 Jul 2020 15:10:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=grem.de; h=date:from:to:cc :subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=20180501; bh=FsnQBMnX jkalfLk1IziWGznYuis=; b=TM4jtfYyKrSvAZNuyF3+Ojv1SZ7wV9euSwRcQ3Xy P1+ckfDDcX4w12M8drHHhVtP1vilfQrBrSKRr7jCl7eJHcT1H1w/utiiwdJoHqVM xRMb7QM0sND6fKhT+dRorddUGbxHQNTQ/cnuJIF2BFnISPFcET3QNoxOO+TgYyqm 4jtkisJ+Tb8KAuKWVSctLXX+fmQcB40Bnsi7V7LTOQLITr9lhfTf6Bh2bIqTB8sa 04pn7yiDA6wbNuhA7B5/NA7wk6x2eq+g81+UAhgQXNfjXy9/sSAAq4B/8U9pdzlw xekb4YdJNyM3/hfdm2hhUIkcLweohnDs1E9Hp/pzEK9PDw== DomainKey-Signature: a=rsa-sha1; c=nofws; d=grem.de; h=date:from:to:cc :subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=20180501; b=qP Tvo7Jrrf5cZZ8HbEjeOs7dFhm/+vlyTqkR2UQSUeZA64EInp2bd5T+XzTvOZhO4G ExCg1epRultY+s8gLaGXr0cBKmMye5JHOj9J0NfcHD+BHffu55by3Dww3b2mFp4+ o6s4vR+hoLlaPjWK1eJ25SxlUI7HdJOQWS6ELkUMveWHptnJzi+GlsHIs/tMoGOO fYwrzjiAxLN41D2UqJKwgYRwfeV342x6nwAK0AP1s/3Ml4v0B2pOBtpJGCUu1omH pdAVROKAHsdieMlNKQujqcqRw65AtNtJDd+a7/NeUjCHUu29bWEwszOWBjjDE2yw JKSLgO0Q1V4jI5D++czA== Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id 6b6dd148 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Tue, 7 Jul 2020 15:10:29 +0000 (UTC) Date: Tue, 7 Jul 2020 17:10:27 +0200 From: Michael Gmelin To: Niclas Zeising Cc: net@FreeBSD.org Subject: Re: Specifying link-local address in rc.conf Message-ID: <20200707171027.4556a126@bsd64.grem.de> In-Reply-To: <20200707120835.4834198e@bsd64.grem.de> References: <713e1f3e-4dd9-8dcf-c6d2-15c684bdce5b@daemonic.se> <20200707120835.4834198e@bsd64.grem.de> X-Face: $wrgCtfdVw_H9WAY?S&9+/F"!41z'L$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-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4B1QqH02Qpz3SYV X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=grem.de header.s=20180501 header.b=TM4jtfYy; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@grem.de designates 213.239.217.29 as permitted sender) smtp.mailfrom=freebsd@grem.de X-Spamd-Result: default: False [-2.87 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[grem.de:s=20180501]; NEURAL_HAM_MEDIUM(-0.91)[-0.915]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:213.239.217.29/32]; NEURAL_HAM_LONG(-1.02)[-1.016]; TAGGED_RCPT(0.00)[freebsd]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grem.de]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[grem.de:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.44)[-0.437]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE]; RCVD_TLS_ALL(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: Tue, 07 Jul 2020 15:10:38 -0000 On Tue, 7 Jul 2020 12:08:35 +0200 Michael Gmelin wrote: > On Mon, 6 Jul 2020 22:58:54 +0200 > Niclas Zeising wrote: >=20 > > On 2020-07-06 13:05, Niclas Zeising wrote: =20 > > > Hi! > > > Is it possible to specify a link-local address in rc.conf, and get > > > only that link-local address? > > >=20 > > > When I add a specific link-local address, such as fe80::1/64, to > > > an interface from the command line, and then add a global uincast > > > address, 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 link-local address assigned to the interface.=C2=A0 It do= es > > > not matter which order I specify the entries in rc.conf. > > > I have tried changing the sysctl net.inet6.ip6.auto_linklocal to 0 > > > in /etc/sysctl.conf, but that does not work (it seems it takes > > > effect too late, the interface still has the AUTO_LINKLOCAL flag > > > set according to ifconfig). > > > I tried adding -auto_linklocal to the ifconfig_* lines in > > > /etc/rc.conf, and while this removes the AUTO_LINKLOCAL flag from > > > the interface, a 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 addresses, this is surprising.=C2=A0 Adding a specific > > > link-local address to an interface, even from rc.conf, shouldn't > > > mean that the EUI64-one is created.=C2=A0 Perhaps something like > > > ifconfig_IF_linklocal=3D"" should be added, or this is a bug in > > > rc.network.=C2=A0 I tried looking through rc.network and related rc > > > files, but I didn't find anything obvious, and I couldn't really > > > figure out how addresses are added to interfaces 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 the EUI64 link-local address as source (which means this > > > also ends up in client routing tables as the default gateway).=C2=A0 I > > > can work around this problem by adding fe80::1/64 with > > > prefer_source, but I would prefer if 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 surprising. > > >=20 > > > I can share more detailed configuration, and perhaps the whole > > > virtual machine I'm testing on, if needed. > > >=20 > > > Regards =20 > >=20 > > I did some more digging. It only happens when there's also an=20 > > ifconfig_IF for IPv4 in the /etc/rc.conf. > >=20 > > 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" > >=20 > > This configuration creates an EUI64-based link-local addess on > > vtnet0 as well. > >=20 > > Working configuration (apart from no IPv4) > > ifconfig_vtnet0_ipv6=3D"inet6 fe80::1/64" > > ifconfig_vtnet0_alias0=3D"inet6 2001:6b8::/64"" =20 >=20 > > =20 >=20 > This works: >=20 > ifconfig_vtnet0=3D"inet6 -auto_linklocal" > ifconfig_vtnet0_ipv6=3D"up" > ifconfig_vtnet0_aliases=3D"\ > inet 192.168.0.1/24 inet6 fe80::1/64 inet6 2001:6b8::/64" >=20 > # ifconfig vtnet0 > vtnet0: flags=3D8943 > metric 0 mtu 1500 options=3D80028 > ether 58:9c:fc:0b:99:97 > inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 > inet6 fe80::1%vtnet0 prefixlen 64 scopeid 0x2 > inet6 2001:6b8:: prefixlen 64 > media: Ethernet 10Gbase-T > status: active > nd6 options=3D1 >=20 > -m >=20 This works too: ifconfig_vtnet0=3D"inet" ifconfig_vtnet0_ipv6=3D"inet6 -auto_linklocal" ifconfig_vtnet0_aliases=3D"\ inet 192.168.0.1/24 inet6 fe80::1/64 inet6 2001:6b8::/64" As well as this: ifconfig_vtnet0=3D"inet" ifconfig_vtnet0_ipv6=3D"inet6 -auto_linklocal fe80::1/64" ifconfig_vtnet0_aliases=3D"inet 192.168.0.1/24 inet6 2001:6b8::/64" Using `ifconfig_vtnet0=3D"inet 192.168.0.1/24"` adds the auto-generated link-local address (which is what you seem to try to avoid). Cheers, Michael --=20 Michael Gmelin