SLES 10 SP2 Xen Network Script


In SLES 10 SP2, the network configuration has changed a bit. For example, the default bridge now just uses “eth0” rather than “xenbr0”. Also some enhancements have been made to virt-manager to allow the user to add network cards more easily.

First before you can have your guests access multiple network cards you must have multiple bridges setup on your Xen host server. By default it will only setup “eth0”. The script in this cool solution will automatically setup all network cards on the host for use with your xen guests.


Setup the networking on each card as you would in a normal setup. Do this while booted to the regular kernel (non-Xen). You can setup public and private networks as you would in any other normal non-Xen setup.

Now implement the “my-network-script3” script to enable each NIC as a xen bridge. You can do this in Xen or regular, but if doing it while in Xen you will need to restart xend aftwards.


  1. Copy my-network-script3 to /etc/xen/scripts
  2. Chmod my-network-script3 IE. chmod 755 /etc/xen/scripts/my-network-script3
  3. Edit the /etc/xen/xend-config.sxp
    Comment out (network-script network-bridge)
    Replace with (network-script my-network-script3)
  4. Restart xend (if booted to Xen) IE. rcxend restart

You are finished. You should now be able to create new vms and add multiple network bridges to them. For example NIC1 add “eth0” and NIC2 add “eth1”

Contents of “my-network-script3”

# This is for SLES10 SP2 host , it won't work on previous versions
# Xen Network script wrapper - detects all bound nics and binds them to xen bridges
# Based on widely used my-network-script.
# Set default values of amount of cards to check, for example check eth0 to eth16

dir=$(dirname "$0")

while ! [ $nicstart -gt $nicend ];

# if card is bound to an ipaddress, add a bridge
cardexist=`ifconfig | grep -m 1 eth$nicstart | awk '{ print $1 }' `

	if test $cardexist
	"$dir/network-bridge" "$@" netdev=eth$nicstart


(Visited 1 times, 1 visits today)


  • Anonymous says:

    you may need to run dos2unix {filename} to get it to run.

    Ayo Adaramola

  • gldavis says:

    This is the first response I have seen of it not working. Did you do a fresh install of sles10sp2 or did you do an upgrade? Are the network cards bound to Ip addresses as shown in yast2 network? Double check you have run the instructions exactly and try rebooting the box.

  • tutech says:

    I tried this script today and Adaramola seems to be right. The script worked not before doing “dos2unix my-network-script3”. After that it works as expected.

    greetings Thomas

  • Nickskall says:

    I also tried to use this Script but after i used the script and change the VM to a second nic the vm wasn’t reachable it seemed to be a capsuled vm.

    Greetings Nick

  • Leave a Reply

    Your email address will not be published. Required fields are marked *