Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

How To Enable Networking In Xen Guests On Hetzner’s New EQ Servers (Debian Lenny)

This tutorial shows how you can enable networking in Xen guests (domU) on Hetzner’s new EQ servers. With the new EQ servers, you can get up to three additional IPs that are in the same subnet as the server’s main IP. The problem is that these additional IPs are bound to the MAC address of the host system (dom0) – Hetzner’s routers will dump IP packets if they come from an unknown MAC address. This means we cannot use Xen’s bridged mode, but must switch to Xen’s routed mode where the host system (dom0) acts as the gateway for the guests.

I do not issue any guarantee that this will work for you!


1 Preliminary Note

I’m assuming that you set up Xen on the EQ server (running Debian Lenny) according to this tutorial: Virtualization With Xen On Debian Lenny (AMD64).

I have an existing Xen guest on the server, I’ve moved it over from another server where it was running in bridged mode. Now I need to configure the routed mode.

  • IP of the EQ server (dom0):
  • Gateway:
  • Netmask:
  • Additonal IP that will be used for (domU):


2 Configure The Host System (dom0)


Open /etc/sysctl.conf and make sure you have the following lines in it:

vi /etc/sysctl.conf




sysctl -p

to read in the new configuration.

Now open /etc/xen/xend-config.sxp and comment out the (network-script network-bridge) and (vif-script vif-bridge) lines and add (network-script network-route) and (vif-script vif-route) instead:

vi /etc/xen/xend-config.sxp

#(network-script network-bridge)
#(vif-script vif-bridge)
(network-script network-route)
(vif-script     vif-route)

Open the configuration file of your Xen guest (in this example it’s /etc/xen/ and make sure it has the correct IP address in it ( in this example):

vi /etc/xen/

#  Networking
vif  = [ 'ip=' ]

Next edit /etc/network/interfaces. Comment out the up route add -net line at the end – this isn’t needed. The file should look similar to this one:

vi /etc/network/interfaces

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

# device: eth0
auto  eth0
iface eth0 inet static

# default route to access subnet
#up route add -net netmask gw eth0

Now reboot the server:



3 Configure The Guest System


After the reboot, please start the guest system, e.g. as follows:

xm create /etc/xen/

Then connect to its console:

xm console


Now in the guest system, open /etc/network/interfaces

vi /etc/network/interfaces

… and make it look as follows:

# 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
auto eth0
iface eth0 inet static

The address line contains the IP of the guest; the gateway line must contain the IP address of the host system (dom0) (, not the host system’s gateway (! The netmask is the same that is used by the host system.

That’s it! now we can restart the guest from the host system:


xm reboot

Afterwards you should be able to connect to the guest and to ping it, and you should also be able to ping other hosts from inside the guest.


  • Xen:
  • Hetzner’s EQ Servers: