From owner-freebsd-virtualization@FreeBSD.ORG Tue Nov 5 18:24:39 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B91FA49D; Tue, 5 Nov 2013 18:24:39 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73C2F2C64; Tue, 5 Nov 2013 18:24:39 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rA5IOaeD054699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Nov 2013 10:24:36 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rA5IOZjF054698; Tue, 5 Nov 2013 10:24:35 -0800 (PST) (envelope-from jmg) Date: Tue, 5 Nov 2013 10:24:35 -0800 From: John-Mark Gurney To: "illoai@gmail.com" Subject: Re: how is the MAC for tap(4) computed? Message-ID: <20131105182435.GT73243@funkthat.com> Mail-Followup-To: "illoai@gmail.com" , Dan Nelson , FreeBSD Stable List , Aryeh Friedman , "freebsd-virtualization@freebsd.org" References: <20131104170955.GH63947@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 05 Nov 2013 10:24:36 -0800 (PST) Cc: FreeBSD Stable List , Dan Nelson , "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2013 18:24:39 -0000 illoai@gmail.com wrote this message on Mon, Nov 04, 2013 at 16:08 -0500: > On 4 November 2013 12:09, Dan Nelson wrote: > > 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'. > > With physical interfaces you can use something like > ifconfig ath0 ether 00:2d:44:88:ff:00 > (assuming the device & the driver support changing MAC > addresses) > > I've never tried it with a virtual interface, but it should work if the > device supports it. But remeber when choosing an address like that, that you set the second low bit of the first octect to one to designate that it's a locally administered address... See wikipedia for more info: https://en.wikipedia.org/wiki/MAC_address#Address_details -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."