Hetzner - DokuWiki

Xen on Debian Lenny using the additional IPs (EQ Series)
  • Check your kernel version with
uname -r

mine was 2.6.26-2-xen-amd64

  • Install the right xen-package
apt-get install xen-linux-system-2.6.26-2-xen-amd64
  • In the file /etc/ysyctl.conf add the following line
net.ipv4.ip_forward=1
  • Now we assume the following:
    • 192.168.2.100 is the first ip address and the one for the dom0
    • 192.168.2.120-122 are the additional ip addresses for the domU's
  • in the /etc/network/interfaces of the dom0 you must make the following adds:
up route add -host 192.168.2.120 gw 192.168.2.120
up route add -host 192.168.2.121 gw 192.168.2.121
up route add -host 192.168.2.122 gw 192.168.2.122

This is cause in the networking setup of hetzner, the ip-packets will be deliverd only to the mac-address of the physical interface. Xen set up an own mac-address for every ip, so the ip-packets for the additional ip's wouldn't be delivered without this entries.

  • in the /etc/network/interfaces of the dom0 you must comment the following line (perhaps in your config it don't exists):
# up route add -net 192.168.2.100 netmask 255.255.255.192 gw 192.168.2.164 eth0
  • In the file /etc/xen/xend-config.sxp make the following change
(network-script network-bridge)
  • Create a directory for the xen images
mkdir /xen
  • Now we can make an image
xen-create-image --hostname=test --size=200Gb --swap=256Mb --ide
--ip=192.168.2.120 --netmask=255.255.255.192 --gateway=192.168.2.100
--dir=/xen --memory=512M --kernel=/boot/vmlinuz-2.6.26-2-xen-amd64
--initrd=/boot/initrd.img-2.6.26-2-xen-amd64 --debootstrap --dist=lenny
--mirror=http://ftp2.de.debian.org/debian/ --passwd

Remark that the gateway is the ip-address of the dom0

  • That we can use the xen console we must add the following line in the file /etc/xen/test.cfg
extra = "console=hvc0 xencons=tty"
  • Now we can start the domU with
xm create test.cfg
  • With the follwoing command we log in to the domU test
xm console test

Remark you can quit the console with Ctrl-5 (on a swiss-german keyboard layout)

  • That we can login with ssh, we must install udev in the domU
apt-get install udev
  • A few xen commands which can be useful
    • xm list --> list of the running domains
    • xm shutdown test --> shutdown the domain regurarly
    • xm destroy test --> like kill -9 for a domU
    • xm top --> like top, but displays also the domU's

Note: The networking setup is from this blog-post:
http://blog.damn1337.de/2009/07/hetzner-eq-serie-mit-zusatzlichen-ip-adressen-howto/
Thanks to Chris Günther



© 2018. Hetzner Online GmbH. Alle Rechte vorbehalten.