3

I'm having a hell of an issue getting networking working in Xen on Ubuntu Server. Our server has a few public IPs (/29) that are all added through eth0 aliases. E.g.

  • eth0 - main ip
  • eth0:0 - first free ip
  • eth0:1 - first free ip
  • eth0:2 - first free ip
  • eth0:3 - first free ip

The IPs are added through /etc/network/interfaces as follows (IPs blanked out for security):

auto eth0
iface eth0 inet static
address ##.##.##.106
netmask 255.255.255.248
network ##.##.##.104
broadcast ##.##.##.111
gateway ##.##.##.105
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8 8.8.4.4
dns-search mydomain.com

auto eth0:1
iface eth0:1 inet static
    address ##.##.##.108
    netmask 255.255.255.248
    network ##.##.##.104
    broadcast ##.##.##.111
    gateway ##.##.##.105

How would I go about exposing eth0:1 to a VM? (It's going to be dedicated to that VM.) Currently I'm working with the PV instructions here.

2 Answers 2

5

First, use bridging. If you were following the howto you linked, you should already have bridging set up.

Second, assign the IP addresses for the VMs within each domU, not within the dom0. The dom0 should only have its own IP address configured when using network bridging.

4
  • The primary problem with this: "This section describes how to set up linux bridging in Xen. It assumes eth0 is both your primary interface to dom0 and the interface you want your VMs to use. It also assumes you're using DHCP." We are not using dhcp, so I'm not sure how to set it up, in regards to static IP's.
    – Jeff M
    Oct 9, 2012 at 0:49
  • 2
    You set up the static IPs the same way you would with a physical host, in /etc/network/interfaces or its equivalent, on each virtual machine. Oct 9, 2012 at 1:04
  • Maybe I'm not being clear enough. I understand the concepts you're relating. I don't understand how to configure them. The syntax. I've already tried creating a xenbr0 interface with the static IP information, per this guide - (wiki.xen.org/wiki/…) - with the ip information in xenbr0 and a blank eth0 ("auto eth0" + "iface eth0 inet static") and did the same with 0:0, in case. perhaps you could provide an example of how you would set the bridging up as you suggest?
    – Jeff M
    Oct 9, 2012 at 1:57
  • Did you click the link that I posted? Your xenbr0 in dom0 gets one of your five IP addresses, and each domU gets one (or more, if you want) of the other four. On dom0, the eth0 interface does NOT get an IP address assigned directly to it. Oct 9, 2012 at 1:59
2

Instead of (on host):

auto eth0
iface eth0 inet static
   address ##.##.##.106
   netmask 255.255.255.248
   network ##.##.##.104
   broadcast ##.##.##.111
   gateway ##.##.##.105
   # dns-* options are implemented by the resolvconf package, if installed
   dns-nameservers 8.8.8.8 8.8.4.4
   dns-search mydomain.com

use:

auto xenbr0
iface xenbr0 inet static
   bridge-ports eth0
   address ##.##.##.106
   netmask 255.255.255.248
   network ##.##.##.104
   broadcast ##.##.##.111
   gateway ##.##.##.105
   # dns-* options are implemented by the resolvconf package, if installed
   dns-nameservers 8.8.8.8 8.8.4.4
   dns-search mydomain.com

Some further reference: XenNetworking

In guest you simply define static IP-s as you would normally do on a 'single' machine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .