Required software
- Debian Etch Linux distribution
Softwate Install
First of all we need to install all the Xen and VLAN management required software.
apt-get install linux-image-2.6.18-5-xen-686 \ xen-hypervisor-3.0.3-1-i386-pae \ xen-utils-3.0.3-1 xen-tools \ vlan bridge-utils libc6-xen
Network Configuration
The server has two identical network interfaces so i'm never sure which name, eth0 or eth1, will be bonded to each physical interface. One way to garantee this is to force the name mapping using udev rules. First check each interface HW address with the ifconfig command. Then rules can be set the following way
KERNEL=="eth*", SYSFS{address}=="00:1a:a0:1c:3f:ae", NAME="eth0", DRIVERS=="?*"
KERNEL=="eth*", SYSFS{address}=="00:1a:a0:1c:3f:ac", NAME="eth1", DRIVERS=="?*"
Then create a symbolic link in the udev rules.d directory to the newly created file so udev uses it.
ln -s /etc/udev/netinterfaces.rules /etc/udev/rules.d/z10_netinterfaces.rules
Also, although it's possible to set network options using Xen's tools, i prefer to do it manually since it allows me to specify multiple vlans to a single interface in a rather easy way, without having to fiddle around Xen's configuration files. \\First we need to disable Xen's options to auto-configure the network parameters. Edit /etc/xen/xend-config.sxp and comment the line
#(network-script network-dummy)
VLAN configuration
Usually i reserve one of the interfaces for management and the other one to bridge over to the VM's with the appropriate VLAN settings. In this example my management interface, eth0, will have the IP 10.1.1.20 and i'm assigning VLAN's 2 and 3 to the bridged interface, which will be eth1.
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0 eth1
auto eth0 eth1 xenbr32 xenbr37
# Management interface
iface eth0 inet static
address 10.1.1.20
netmask 255.255.255.0
network 10.1.1.0
broadcast 10.1.1.255
gateway 10.1.1.254
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.1.1.1
dns-search domain.com
# Bridged interface
iface eth1 inet manual
up ifconfig eth1 up
iface xenbr2 inet manual
up vconfig add eth1 2
up ifconfig eth1.2 up
up brctl addbr xenbr2
up ifconfig xenbr2 up
up brctl addif xenbr2 eth1.2
down brctl delif xenbr2 eth1.2
down vconfig rem eth1.2
down ifconfig xenbr2 down
down brctl delbr xenbr2
iface xenbr3 inet manual
up vconfig add eth1 3
up ifconfig eth1.3 up
up brctl addbr xenbr3
up ifconfig xenbr3 up
up brctl addif xenbr3 eth1.3
down brctl delif xenbr3 eth1.3
down vconfig rem eth1.3
down ifconfig xenb3 down
down brctl delbr xenbr3
Reboot and start creating VM's.
If you found the information on these pages usefull, please, consider clicking on one of the sponsored links on the left or use the Paypal button if you're feeling really generous. :)
- Last modified: 2008/04/19 02:39 by hmmm



