Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 2021 05:14:50 -0700
From:      Kyle Evans <kevans@freebsd.org>
To:        Kurt Jaeger <pi@freebsd.org>
Cc:        FreeBSD Net <net@freebsd.org>
Subject:   Re: source of ether address for tap0 ?
Message-ID:  <CACNAnaEVZoe87kP0_Mn2jspi3UszX1F5nYdLh9QZ4MY%2BmGSSNA@mail.gmail.com>
In-Reply-To: <YH69IcM2turVK59h@home.opsec.eu>
References:  <YH69IcM2turVK59h@home.opsec.eu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Apr 20, 2021 at 4:38 AM Kurt Jaeger <pi@freebsd.org> 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<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         options=80000<LINKSTATE>
>         ether 58:9c:fc:10:98:02
>         groups: tap
>         media: Ethernet autoselect
>         status: no carrier
>         nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
>
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaEVZoe87kP0_Mn2jspi3UszX1F5nYdLh9QZ4MY%2BmGSSNA>