Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 8763144197db7dd837c794bb2da1fedf > files > 10

xen-3.0.3-142.el5_9.3.x86_64.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