From owner-freebsd-net@freebsd.org Tue Jul 7 10:08:50 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 5696F35C579 for ; Tue, 7 Jul 2020 10:08:50 +0000 (UTC) (envelope-from freebsd@grem.de) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1J760JMMz4Lwp for ; Tue, 7 Jul 2020 10:08:50 +0000 (UTC) (envelope-from freebsd@grem.de) Received: by mailman.nyi.freebsd.org (Postfix) id 0A5CF35CA3A; Tue, 7 Jul 2020 10:08:50 +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 0A22735CACE for ; Tue, 7 Jul 2020 10:08:50 +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 4B1J746823z4Lt1 for ; Tue, 7 Jul 2020 10:08:48 +0000 (UTC) (envelope-from freebsd@grem.de) Received: by mail.evolve.de (OpenSMTPD) with ESMTP id a6a4cdea; Tue, 7 Jul 2020 10:08:39 +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=iOmHSbVK LyzYkHEgjCKuiLgBC1Y=; b=DNzHmMJ/t3SDTQFQg9nf/kJ5eGgqAR4W9Xo2vAzN Bv+MKiiKI5Ae6zVvi3MXU7ei7Sn72Ux52woRRqJjo7frYHQlpxd6f67B1QT5DdZ2 gVBDMpIUOc6e4A/Bfxq1Ju/Y75lWGVora/jTgZPB9JyKdCrahmCBh4zPdkXlUzgp nQgrHYRH9qOP7hZ7K5W8ApHgbgavfpqWvl6SuzvbxLuil+CN/BhsPqeysjxkqq1s Fy85FXGhrb2f0yZfeLD+9kY3q0nc6bO4R0Jhcd7psKQ9iB53+K/kVhF0pH7KfHXG rYtBMO259vDSJStAc2r5UPuA8U7hOTFif8j22JtCkImRng== 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=Og EqtxpT/UVoaZN8PDYr1U80y/n93LzJym1UfyhJ6qQ7jon2cl5vTMWUuX72TPmfsF 6teWR3Dlmp0wr2bB3Ihl4iBi7X6nXQO5eO8PsL9VkulXuF5wTEO0L7DaN6TbyFCT 5YBuiLXxQ8+eromKbPA7FEuy9axsQNuSvSt9CFoDgzNOumSLaIFNNzjSbeKbjhqH L1rTy0X23tVqHIRnVEq/y5I89wglNvr/1rIqBabB+p/OQTmTsZ6iODAxvgauOWzU UhIHDi7JdOn+0VL6wMH8TKZJCEpkYYYcfbg3TlKX154glsNgVjDrIQvHViT030Ny 8rSoRzJaeapTF2VIU+vw== Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id 78866b9b (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Tue, 7 Jul 2020 10:08:37 +0000 (UTC) Date: Tue, 7 Jul 2020 12:08:35 +0200 From: Michael Gmelin To: Niclas Zeising Cc: net@FreeBSD.org Subject: Re: Specifying link-local address in rc.conf Message-ID: <20200707120835.4834198e@bsd64.grem.de> In-Reply-To: References: <713e1f3e-4dd9-8dcf-c6d2-15c684bdce5b@daemonic.se> X-Face: $wrgCtfdVw_H9WAY?S&9+/F"!41z'L$uo*WzT8miX?kZ~W~Lr5W7v?j0Sde\mwB&/ypo^}> +a'4xMc^^KroE~+v^&^#[B">soBo1y6(TW6#UZiC]o>C6`ej+i Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWJBwe5BQDl LASZU0/LTEWEfHbyj0Txi32+sKrp1Mv944X8/fm1rS+cAAAACXBIWXMAAAsTAAAL EwEAmpwYAAAAB3RJTUUH3wESCxwC7OBhbgAAACFpVFh0Q29tbWVudAAAAAAAQ3Jl YXRlZCB3aXRoIFRoZSBHSU1QbbCXAAAAAghJREFUOMu11DFvEzEUAGCfEhBVFzuq AKkLd0O6VrIQsLXVSZXoWE5N1K3DobBBA9fQpRWc8OkWouaIjedWKiyREOKs+3PY fvalCNjgLVHeF7/3bMtBzV8C/VsQ8tecEgCcDgrzjekwKZ7TwsJZd/ywEKwwP+ZM 8P3drTsAwWn2mpWuDDuYiK1bFs6De0KUUFw0tWxm+D4AIhuuvZqtyWYeO7jQ4Aea 7jUqI+ixhQoHex4WshEvSXdood7stlv4oSuFOC4tqGcr0NjEqXgV4mMJO38nld4+ xKNxRDon7khyKVqY7YR4d+Cg0OMrkWXZOM7YDkEfKiilCn1qYv4mighZiynuHHOA Wq9QJq+BIES7lMFUtcikMnkDGHUoncA+uHgrP0ctIEqfwLHzeSo+eUA66AqzwN6n 2ZHJhw6Qh/PoyC/QENyEyC/AyNjq74Bs+3UH0xYwzDUC4B97HgLocg1QLYgDDO1v f3UX9Y307Ew4AHh67YAFFsxEpkXwpXY3eIgMhAAE3R19L919nNnuD2wlPcDE3UeT L2ytEICQib9BXgS2fU8PrD82ToYO1OEmMSnYTjSqSv9wdC0tPYC+rQRQD9ESnldF CyqfmiYW+tlALt8gH2xrMdC/youbjzPXEun+/ReXsMCDyve3dZc09fn2Oas8oXGc Jj6/fOeK5UmSMPmf/jL+GD8BEj0k/Fn6IO4AAAAASUVORK5CYII= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4B1J746823z4Lt1 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=grem.de header.s=20180501 header.b=DNzHmMJ/; 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 [-3.17 / 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.914]; 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.017]; 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.74)[-0.736]; 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 10:08:50 -0000 On Mon, 6 Jul 2020 22:58:54 +0200 Niclas Zeising wrote: > 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 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, 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 does > > 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 This works: 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" # 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 -m --=20 Michael Gmelin