[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] Re: Random MAC addresses in Xen



On Tue, Apr 04, 2006 at 03:47:37PM -0700, Fong Vang wrote:
> I could have potentially hundreds of domUs bridged in the same
> network.  What's the easiest way to assign MAC addresses for domUs? 
> In random mode, how does Xen pick MAC addresses?  Once a MAC is chosen
> for a domU, will it remain fixed?  How does Xen know whether a MAC
> address has already been assigned?

I use the following snippet in my domU setup script to create a MAC address
for a new host:

MACADDR="aa:00:$(echo $VHOSTNAME | md5sum                               \
        | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')"

Then substitute MACADDR into the template config file we use here.

Yes, there is a (small but) non-zero chance of collision.  No, I don't care.

- Matt

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.