#!/bin/sh #. /etc/rc.d/init.d/functions #ulimit -c unlimited echo 'config qemu network with xen bridge for ' $* mac=`printf "fe:%02x:%02x:%02x:%02x:%02x" \ $(($RANDOM % 256)) $(($RANDOM % 256)) $(($RANDOM % 256)) \ $(($RANDOM % 256)) $(($RANDOM % 256))` ifconfig $1 hw ether ${mac} # Set the MTU of the interface to match the bridge if [ -e "/sys/class/net/$2/mtu" ]; then ifconfig $1 mtu `cat /sys/class/net/$2/mtu` || : fi ifconfig $1 0.0.0.0 up brctl addif $2 $1