Sophie

Sophie

distrib > CentOS > 5 > i386 > media > os > by-pkgid > 0ad3da325f9405c8505ae07dcd8c3989 > files > 10

xen-3.0.3-142.el5_9.3.i386.rpm

#!/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