From owner-freebsd-net@freebsd.org Mon Jul 6 11:05:46 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 CE3D6364086 for ; Mon, 6 Jul 2020 11:05:46 +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 4B0jRG4Lfsz3dLT for ; Mon, 6 Jul 2020 11:05:46 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: by mailman.nyi.freebsd.org (Postfix) id 93857363CF5; Mon, 6 Jul 2020 11:05:46 +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 934FB364103 for ; Mon, 6 Jul 2020 11:05:46 +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 4B0jRF0D1bz3dfF for ; Mon, 6 Jul 2020 11:05:44 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 4B0jR51MsSz3mQC for ; Mon, 6 Jul 2020 11:05:37 +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:mime-version:user-agent:date:date:message-id :subject:subject:from:from:received:received; s=20151023; t= 1594033536; bh=j+LrBvobKWKbALYhYpkkfrAiR1FQckJhqUX0zyoPBns=; b=g NWUaDemQaQzj4puodz7tpoBNpJ3/+ubofXU/AqmRavgYXE1vydRl5qFcXzgZreK1 Kgb36d4ZbCn7hr/xJ8VG5J2D5y8l6h4RGeqqCORj8RODGOBt4GhfWm3Ml8ohqZBq jAPqdhUv+Bj5J4A/vNFHk5gCcQwSxMPsuq2pN6CczQ= 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 ITB4SdLb1alA for ; Mon, 6 Jul 2020 11:05:36 +0000 (UTC) Received: from garnet.daemonic.se (host-95-195-31-128.mobileonline.telia.com [95.195.31.128]) by mail.daemonic.se (Postfix) with ESMTPSA id 4B0jR40MXPz3mMv for ; Mon, 6 Jul 2020 11:05:35 +0000 (UTC) To: net@FreeBSD.org From: Niclas Zeising Subject: Specifying link-local address in rc.conf Message-ID: <713e1f3e-4dd9-8dcf-c6d2-15c684bdce5b@daemonic.se> Date: Mon, 6 Jul 2020 13:05:26 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4B0jRF0D1bz3dfF X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=daemonic.se header.s=20151023 header.b=g NWUaDe; 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 [-4.03 / 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.03)[-1.029]; 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(-0.97)[-0.969]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[daemonic.se:+]; DMARC_POLICY_ALLOW(-0.50)[daemonic.se,none]; NEURAL_HAM_SHORT(-1.03)[-1.027]; 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)[]; RECEIVED_SPAMHAUS_PBL(0.00)[95.195.31.128:received] 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 11:05:46 -0000 Hi! Is it possible to specify a link-local address in rc.conf, and get only that link-local address? 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="inet6 fe80::1/64" ifconfig_vtnet0_alias0="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. 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. While there might not be much of a problem having mulitple link-local addresses, this is surprising. Adding a specific link-local address to an interface, even from rc.conf, shouldn't mean that the EUI64-one is created. Perhaps something like ifconfig_IF_linklocal="" should be added, or this is a bug in rc.network. 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. This is causing issues when I want for instance rtadvd to use the 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). 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. All of this is on FreeBSD 12.1. Perhaps I'm just missing something, but this behavior feels a little surprising. I can share more detailed configuration, and perhaps the whole virtual machine I'm testing on, if needed. Regards -- Niclas