Daniel Lezcano <daniel.lezc...@free.fr> writes: > On 02/02/2011 10:26 AM, Trent W. Buck wrote: >> For each lxc.network.type = veth, if you DON'T specify an >> lxc.network.hwaddr, you get one assigned at random (example below). >> >> Are these assignments made from a reserved range (a la 169.254/16 in >> IPv4), or are they randomized across the entire address space? AFAICT, >> it MUST be the latter. >> >> Further, when manually allocating a static hwaddr (so I can map it to an >> IP within the DHCP server), > > The dhcp relies on an identifier to map the IP, the default is to use > the mac address but you can use another identifier like the hostname > for example.
Good idea, although that would make configuring my DHCP server (dnsmasq) a little more fiddly. Currently I just populate ethers(5) on the DHCP server, and dnsmasq automagically uses that mapping (as opposed to adding lines into the dnsmasq.conf). > AFAIR, there is an option in the system network configuration scripts > to send the hostname for the dhcp requests. There is; it's ``send host-name "foo";'' On Ubuntu this is even the default: they have patched their ISC dhclient package to allow ``send host-name "<hostname>";'', which sends the same string as `hostname' emits. > This is how the kernel allocates the mac address. > > static inline void random_ether_addr(u8 *addr) > { > get_random_bytes (addr, ETH_ALEN); > addr [0] &= 0xfe; /* clear multicast bit */ > addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ > } Cool, thanks. > Maybe you can use the mac address range used for the virtual nic of > vmware. Another solution would be to buy a cheaper nic, get its mac > address, break and drop the nic :) Hehe. I'll try just assigning from the local unicast range, and see if I run into problems. ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users