Multiple Interfaces for Xen

Why Use Multiple Interfaces?

On a simple Xen host system there is only one network interface (such as eth0), typically connected to the Internet. All Xen systems have their own virtual eth0 interface which is bridged to the host system via Xen's xenbr0 interface.

However, you may want to configure host systems with two interfaces, one connected to the Internet and one on a private network for transfers between host or virtual systems. This involves adding an additional bridge (usually xenbr0) to the Xen configuration on the host, and configuring Cloudmin to create new Xen systems with a second interface this is connected to the bridge.

Configuring Xen on the Host System

This configuration must be done manually, as Cloudmin does not yet support managing the xend configuration file on a host. The steps to follow are :

  1. SSH into the host system as root, and create the file /etc/xen/scripts/multiple-bridge with the following contents :
    #!/bin/sh
    dir=$(dirname "$0")
    "$dir/network-bridge" "$@" vifnum=0 netdev=eth0 bridge=xenbr0
    "$dir/network-bridge" "$@" vifnum=1 netdev=eth1 bridge=xenbr1
  2. Make the file executable with the command chmod +x /etc/xen/scripts/multiple-bridge
  3. Edit the file /etc/xen/xend-config.sxp and find the line like (network-script network-bridge) line, and change it to (network-script multiple-bridge)
  4. Restart Xen with the command /etc/init.d/xend restart
  5. Verify that the xenbr1 bridge has been created with the ifconfig -a command.

If you have multiple host systems, these steps must be performed on each of them.

Configuring Cloudmin

Once the additional bridge is active on the Xen host, you can configure Cloudmin to use it as follows :

  1. Go to Host Systems -> Xen Host Systems, and click on the host.
  2. In the Bridges on host system for Xen interfaces field, select both xenbr0 and xenbr1.
  3. In the IP address allocation range table, add a row with a range of IPs to use on your internal network, such as 192.168.1.1 to 192.168.1.254, with CIDR set to 24. Select your new xenbr1 bridge in the For interface column.
  4. Click the Save button.

How you can create a new Xen virtual system, and it should be configured with two network interfaces, with eth1 connected to eth1 on the host system, and an IP assigned from the 192.168.1 range.