From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: Mac-Address uniqueness Date: Fri, 1 Jun 2007 14:09:49 +0100 Message-ID: <20070601130949.GA6071@redhat.com> References: <465E98B7.5050402@univie.ac.at> <465F72EA.9080608@zytor.com> <465FBC08.7000102@qumranet.com> <465FC01F.4050105@zytor.com> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Axel Kittenberger To: "H. Peter Anvin" Return-path: Content-Disposition: inline In-Reply-To: <465FC01F.4050105-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Thu, May 31, 2007 at 11:43:43PM -0700, H. Peter Anvin wrote: > Avi Kivity wrote: > > H. Peter Anvin wrote: > >> Axel Kittenberger wrote: > >> > >>> Unfortunally all machines detect the same ethernet address > >>> '52:54:00:12:34:56'. Which you can guess what i means, networking comes > >>> and goes whatever machine last the ethernet address got hold of from the > >>> gateway. I tried specifing an ethernet-adress with "-net > >>> nic,macaddr=$MAC" but this also didn't work through. > >>> > >>> For now I just hardseted the mac in all machines to 52:54:00:12:34:57, > >>> 52:54:00:12:34:58 and so on. > >>> > >>> > >> This is a Qemuism. I always thought it was dumb, but I guess Qemu > >> wanted reproducibility over everything. > >> > >> IMNSHO it would have been much better to default to a random value > >> (meaning that all except the bottom 2 bits of the first octet are > >> random, those bits should be set to 10 binary.) > >> > >> > > > > That tends to consume dhcp leases quickly, if you start guests often (as > > I do). Also, some distributions use the mac address as a key for naming > > interfaces; if it changes, the guest gets confused > > > > The right solution to that, of course, is a VM definitions file, so the > random Ethernet address is only generated once. For Qemu/KVM, that > could at least in theory simply be a shell script. This is the approach we use in libvirt. If the user defines a guest and does not provide a mac address, we generate one for each NIC and store it in the config file, so every time it gets the same MAC. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/