How To Enable Networking In Xen Guests On Hetzner's New EQ Servers (Debian Lenny)
|
Submitted by falko (Contact Author) (Forums) on Sun, 2009-10-25 18:38. :: Debian | Xen | Virtualization
How To Enable Networking In Xen Guests On Hetzner's New EQ Servers (Debian Lenny)Version 1.0 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 NoteI'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, vm.example.com. I've moved it over from another server where it was running in bridged mode. Now I need to configure the routed mode.
2 Configure The Host System (dom0)dom0: Open /etc/sysctl.conf and make sure you have the following lines in it: vi /etc/sysctl.conf
Run 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
Open the configuration file of your Xen guest (in this example it's /etc/xen/vm.example.com.cfg) and make sure it has the correct IP address in it (188.40.103.103 in this example): vi /etc/xen/vm.example.com.cfg
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
Now reboot the server: reboot
3 Configure The Guest Systemdom0: After the reboot, please start the guest system, e.g. as follows: xm create /etc/xen/vm.example.com.cfg Then connect to its console: xm console vm.example.com domU: Now in the guest system, open /etc/network/interfaces... vi /etc/network/interfaces ... and make it look as follows:
The address line contains the IP of the guest; the gateway line must contain the IP address of the host system (dom0) (188.40.103.70), not the host system's gateway (188.40.103.65)! 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: dom0: xm reboot vm.example.com 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.
4 Links
|




Recent comments
1 day 9 hours ago
1 day 14 hours ago
1 day 18 hours ago
1 day 20 hours ago
2 days 10 hours ago
2 days 10 hours ago
2 days 15 hours ago
2 days 22 hours ago
2 days 23 hours ago
3 days 31 min ago