Debian – Setting Up Xen and Network Bridge on Debian 7

bridgedebiannetworkingvirtualizationxen

Setting up Xen and Network Bridges on Debian 7

Hi there. So i am finally going to try out some virtualisation on my new dedicated machine, however i am having some problems / confusion on setting it up, so i will try best to explain my situation, and any help would be much appreciated.

To start, my server has ONE physical network adapter, eth0. The default configuration within /etc/network/interfaces is as follows


### Hetzner Online AG - installimage
# Loopback device:
auto lo
iface lo inet loopback

# device: eth0
auto  eth0
iface eth0 inet static
  address   144.76.29.149
  broadcast 144.76.29.159
  netmask   255.255.255.224
  gateway   144.76.29.129
  # default route to access subnet
  up route add -net 144.76.29.128 netmask 255.255.255.224 gw 144.76.29.129 eth0

iface eth0 inet6 static
  address 2a01:4f8:191:2094::2
  netmask 64
  gateway fe80::1

However i also have a second IP allocation i purchased from my host, just to confirm i can successfully setup what i would like to do (Run roughly 3 virtual machines, each on their own external IP address) on my machine

The information for the second allocation is:


Address 144.76.47.82
Gateway 144.76.47.81
Netmask 255.255.255.248
Broadcast 144.76.47.87

I have installed bridge-utils as directed in the guide i have been following ( http://wiki.xen.org/wiki/Xen_Beginners_Guide#Preparation )

I then add my new bridge using brctl addbr xenbr0

This is where i get stuck, or normally break my networking, which means i have to go into recovery and restore it to what it was originally, which is expected as i do not understand how this all works as of yet.

I am confused because i have seen some guides where you need to setup iface eth0 inet manual and then configure the static ip on the iface xenbr0 inet static and some where it is vice versa. Either way i have attempted has ended up in me breaking my networking as such

So, as a quick summary of what i would like too do:

  • I would like to be able to assign each of my virtual machines their own external IP address
  • I would like to have the dom0 using my first IP allocation (144.76.29.149) and my second machine (Which i am using as a tester) using my second IP allocation (144.76.47.82)
  • I assume i have to use bridge tools to do this correctly? As the Xen guide suggests

I have not been able to find any tutorials which could guide a newbie through this, as i have not used / been into linux networking much, as my machines have always already had it completely configured and ready.

Thanks for any help or articles you point me towards

Best Answer

You want your interfaces file to look like this. Yes, you'll need bridge-utils

auto eth0
iface eth0 inet manual

auto xenbr0
iface xenbr0 inet static
    bridge_ports eth0
    address   144.76.29.149
    netmask   255.255.255.224
    gateway   144.76.29.129
    post-up route add -net 144.76.29.128 netmask 255.255.255.224 gw 144.76.29.129 eth0
iface xenbr0 inet6 static
    address   144.76.29.149
    broadcast 144.76.29.159
    netmask   255.255.255.224
    gateway   144.76.29.129

Now, what you want to do is add a second subnet to your internal machine; you're going to need some more post-up routes for that which is out of my scope. But this should get your Dom0 working and a bridge ready for your DomU.