[Lxc-users] updated lxc template for debian squeeze - with attachedscript ; )
John Soros
johnny at r0x0r.me
Tue Mar 1 17:18:17 UTC 2011
Hi,
i have tried to find an rfc about this but have failed, instead, the
only (serious/credible) documentation i could find was
http://wiki.xen.org/xenwiki/XenNetworking#head-d5446face7e308f577e5aee1c72cf9d156903722 ,
so i updated the script accordingly, here is the updated patch.
again,
Signed-off-by: John Soros <johnny at r0x0r.me>
--
the router thinks its a printer.
On Fri, 25 Feb 2011 09:03:55 +0100
Jäkel, Guido <G.Jaekel at dnb.de> wrote:
> Dear John,
>
> > - generate random mac address for the guest so it gets always the
> > same lease from a dhcp server
>
> You suggest doing this by
>
> macaddr=$(echo -n 00; hexdump -n 5 -v -e '/1
> ":%02X"' /dev/urandom)
>
>
>
> I think this is a "little bit to random". The german Wikipedia tells
> at http://de.wikipedia.org/wiki/MAC-Adresse about a reserved MAC
> range for private use (sorry, it's not in corresponding the English
> article):
>
> ["Neben der OUI existiert auch ein kleiner Adressbereich (IAB
> - Individual Address Block), der für Privatpersonen und kleine Firmen
> und Organisationen vorgesehen ist, die nicht so viele Adressen
> benötigen. Die Adresse beginnt mit 00-50-C2 und wird von drei
> weiteren Hex-Ziffern gefolgt (12 Bits), die für jede Organisation
> vergeben werden. Damit verbleibt der Adressbereich innerhalb der Bits
> 11 bis 0 nutzbar wodurch 212 = 4096 individuelle Adressen möglich
> sind."]
>
>
>
> Maybe we should take respect to this and we should use
>
> macaddr=$(echo -n "00:50:C2"; hexdump -n 3 -v -e '/1
> ":%02X"' /dev/urandom)
>
> for this. Another approach is to derive it from the designated name
> of the container (i.e. $hostname in terms of the script). Because
> there might be typical clustering naming schemes based on a name and
> some digits, I suggest to select the first and the last two
> characters of the hostname (filled by random for the unlikely case of
> a hostname shorter than 3 chars)
>
> echo -n "00:50:C2"; echo "${hostname:0:1}${hostname: -2}
> $(head -c 3 /dev/urandom) " | hexdump -n 3 -v -e '/1 ":%02X"'
>
> -> 00:50:C2:<first>:<nextlast>:<last> filled by random
>
>
>
> @Daniel: Because this will have a common use for all, it might be
> included into the lxc-conf parser
>
> ["lxc.network.hwaddr: the interface mac address is
> dynamically allocated by default to the virtual interface ...]"
>
>
> We maybe should have a special keyword for a "derived" semi-static
> MAC that would not change at every startup of the container but may
> be calculated by the formula given above.
>
>
> Guido
>
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT
> data in Real-Time with Splunk. Collect, index and harness all the
> fast moving IT data generated by your applications, servers and
> devices whether physical, virtual or in the cloud. Deliver compliance
> at lower cost and gain new business insights.
> http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________ Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lxc-debian.diff
Type: text/x-patch
Size: 2983 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20110301/dca68b9c/attachment.bin>
More information about the lxc-users
mailing list