Nirmal Guhan <vavat...@gmail.com> writes:

> On Wed, Feb 2, 2011 at 6:25 PM, Trent W. Buck <t...@cybersource.com.au> wrote:
>> "Brian K. White" <br...@aljex.com> writes:
>>
>>> I just use 02:00:<ip address> which ends up being automatically unique
>>> enough to not collide with anything else on your subnet assuming you
>>> already know the ip's you want to use
>>>
>>> IP=192.168.0.50   # container nic IP
>>> HA=`printf "02:00:%x:%x:%x:%x" ${IP//./ }` # generate a MAC from the IP
>>
>> I think I'll adopt a slight variation of this -- computing the MAC from
>> the hostname, which are guaranteed by my site policy to be [a-z]{5}.
>> Where 06 is an arbitrarily chosen local unicast range,
>>
>>    $ f () { python -c "print '06%010x' % int('$(LC_ALL=C tr <<<"$1" a-z 
>> 0-9a-p)',26)"; }
>>    $ f zorba
>>    060000b240be
>>
>> This allows my DHCP server to continue mapping MAC->IP, while actually
>> getting it from a hostname (which policy says won't change).
>>
>> And I'll do this for all my containers, so that even containers that
>> have automatically assigned IPs will be relatively persistent (because
>> dnsmasq remembers MAC->IP leases and re-uses them preferentially).
>
> Provided container's hostname are unique across different hosts?

Certainly; mine are.


------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to