From owner-freebsd-net@freebsd.org Tue Apr 20 12:15:02 2021 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 936625F3B55 for ; Tue, 20 Apr 2021 12:15:02 +0000 (UTC) (envelope-from kevans@freebsd.org) 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 4FPjLG3jtsz4g7b for ; Tue, 20 Apr 2021 12:15:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 7DB005F397A; Tue, 20 Apr 2021 12:15:02 +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 7D7AE5F3B54 for ; Tue, 20 Apr 2021 12:15:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FPjLG37ngz4fwN; Tue, 20 Apr 2021 12:15:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 59C99B3F8; Tue, 20 Apr 2021 12:15:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f176.google.com with SMTP id s4so624924qtw.3; Tue, 20 Apr 2021 05:15:02 -0700 (PDT) X-Gm-Message-State: AOAM530mNjdjjcEQzjd9mLFC9OwZhZ54lRCnZawUpw9KI4f/Nu8BVetf Ol9fgfgNtMxoipa/RGIEit/rYOYAzA9mhmFyFeE= X-Google-Smtp-Source: ABdhPJwSPdWFzjYmh0kmLhCyQJoTPfFwA0ehisAQb3B2lw22AeBaI6qCfQpjzhZ0/hqleRP5Uq1QIW81r+53rLEhY4Q= X-Received: by 2002:ac8:a02:: with SMTP id b2mr16651690qti.310.1618920901818; Tue, 20 Apr 2021 05:15:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kyle Evans Date: Tue, 20 Apr 2021 05:14:50 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: source of ether address for tap0 ? To: Kurt Jaeger Cc: FreeBSD Net Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 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, 20 Apr 2021 12:15:02 -0000 On Tue, Apr 20, 2021 at 4:38 AM Kurt Jaeger wrote: > > Hello, > > does anyone know how the system selects the MAC/ether adress of a > newly-created tap0 device ? > > ifconfig tap0 create > > has this: > > tap0: flags=8802 metric 0 mtu 1500 > options=80000 > ether 58:9c:fc:10:98:02 > groups: tap > media: Ethernet autoselect > status: no carrier > nd6 options=29 > > How is that selected ? > > We had a case where two devices selected the same ether/MAC... > tap MACs are derived from the hostid (/etc/hostid) -- you generally end up with the same MAC in one of two scenarios: 1.) The hosts have identical /etc/hostid (bad, probably an issue with machine provisioning where the hostid file is getting copied and thus, not regenerated at boot?), or 2.) hostid isn't being preloaded #2 may be the case if it's a machine that doesn't use loader, or you've specifically disabled it with hostuuid_load="NO" in loader.conf. I've got a WIP to improve the failure mode for that one to fallback to a fully random MAC. #1 can be fixed by moving hostid out of the way and letting the hostid rc scripts generate and save a new one, assuming they're not getting their data from bogus/duplicate smbios uuids. Thanks, Kyle Evans