Hmmm, I see that the MAC address of eth0 isn't set until it is
assigned an IP address, since it uses the IP address to create a unique
I'm playing with DHCP and IPv6 (with IPv4 as well), and this means that I
can't specify an address based on the hardware address, because the client
doesn't know it (the UML-Chicken-n-Egg problem -- in keeping with the
farmyard environment full of COWs :)
So far, I can think of two solutions:
1) Use a DHCP hostname. I'd rather not do this, since I'll be using UML in
teaching a network management course (TELE301 at the University of Otago
in New Zealand), and I'd like to use the ``hardware ethernet <mac-addr>''
component of dhcpd.
2) Create the mac address somehow based on the filename of the COW
filesystem. This would be ideal for my environment I think.
In case anyone is interested in doing the same, I've hacked up a wee
script that uses md5sum to generate a (nearly perfect?) MAC address for
based on a unique text identifier, such as the name of a COW file. Here it
--start of file umlmac--
if [ \( $# != 1 \) -o \( "$1" = "-h" \) -o \( "$1" = "--help" \) ]; then
echo "Usage: `basename $0` <name>" >&2
echo "Where <name> is a unique text identifier"
echo "$1" | md5sum - | cut -b-8 | \
sed -e 's/\(..\)\(..\)\(..\)\(..\)/FE:FD:\1:\2:\3:\4/' | \
tr '[[:lower:]]' '[[:upper:]]'
--end of file--
Here's an example of how to use it. ipv6- are the COW files for two
cameron@...:/uml/slackware-8.1$ ./umlmac ipv6-1
cameron@...:/uml/slackware-8.1$ ./umlmac ipv6-2
Now I just need to integrate this in my wrapper script that launches my
Hope this helps someone. This email did start out as a question, but as
often happens, I came up with a solution while thinking about the problem