Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Nov 2013 11:09:55 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Aryeh Friedman <aryeh.friedman@gmail.com>
Cc:        FreeBSD Stable List <freebsd-stable@freebsd.org>, "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org>
Subject:   Re: how is the MAC for tap(4) computed?
Message-ID:  <20131104170955.GH63947@dan.emsphone.com>
In-Reply-To: <CAGBxaXn27u3J6iJBoDkW_R2=_kcHzSBU=d0v5eDUvnoAsucSjw@mail.gmail.com>
References:  <CAGBxaXn27u3J6iJBoDkW_R2=_kcHzSBU=d0v5eDUvnoAsucSjw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Nov 04), Aryeh Friedman said:
> There seems to be a very high rate of MAC address collisions when tap is
> running on different machines....  is there anyway to make the selection
> of MAC more random

It looks like it's generated based on the number of ticks since boot, plus
the unit number of the tap device:

http://fxr.watson.org/fxr/source/net/if_tap.c#L434

So if you have devices created on boot on a bunch of machines, chances are
high that you'll get conflicts.  Maybe instead of using the 'ticks' value,
kern.hostid could be used instead?  That has much better randomness than
'ticks'.

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131104170955.GH63947>