problem with setting up Xen networking

Werner Schram wrschram at gmail.com
Tue Feb 2 11:46:07 UTC 2010


On Tue, Feb 2, 2010 at 1:37 AM, Amedee Van Gasse
<amedee-ubuntu at amedee.be> wrote:
> On 01-02-10 09:39, Werner Schram wrote:
>
>> I personally prefer to manage my bridges manually via
>> /etc/network/interfaces, every virtualization platform has its own
>> bridge management system, which doesn't always work well with your
>> distributions network configuration. I find it strange that your
>> bridge is added to the eth0 bridge in your case, as you specificly
>> added it to xenbr0 (which wasn't created). I remember seeing the
>> eth0-peth0 type of bridge before, but I can't remember how that got
>> created. My guess is that it is a misconfiguration in your
>> xend-config.sxp.
>>
>> Anyway, your xen managed bridge configuration is in
>> /etc/xen/xend-config.sxp. There should a line like:
>> (network-script 'network-bridge bridge=mybridge')
>>
>> My advice would be to disable that line and configure a bridge in
>> /etc/network/interfaces, but if you post that line, maybe we can work
>> out what is wrong.
>
> Perhaps I misunderstood you, but I disabled everything in /etc/xen/mx1,
> /etc/xen/xend-config.sxp and /etc/networking/interfaces, except for the
> lo and eth0 dhcp. I changed nothing inside the DomU.
>
> Now when I start the DomU, I get the following error:
>
> eth0: ERROR while getting interface flags: No such device
> Failed to bring up eth0.
>
> Of course, no networking.
>
>
> Next step, configure a bridge more or less as described on
> https://help.ubuntu.com/8.10/serverguide/C/network-configuration.html
>
> this is now my /etc/network/interfaces:
>
> auto lo
> iface lo inet loopback
>
> allow-hotplug eth0
> iface eth0 inet dhcp
>
> auto dummy0
> iface dummy0 inet static
>         address 192.168.2.1
>         broadcast 192.168.2.255
>         netmask 255.255.255.0
>
> auto br0
> iface br0 inet static
>         address 192.168.2.10
>         network 192.168.2.0
>         netmask 255.255.255.0
>         broadcast 192.168.2.255
>         gateway 192.168.2.1
>         bridge_ports dummy0
>         bridge_fd 9
>         bridge_hello 2
>         bridge_maxage 12
>         bridge_stp off
>
>
> That gives the following ifconfig:
> br0       Link encap:Ethernet  HWaddr 12:a8:13:88:24:29
>           inet addr:192.168.2.10  Bcast:192.168.2.255  Mask:255.255.255.0
>           inet6 addr: fe80::10a8:13ff:fe88:2429/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:0 (0.0 B)  TX bytes:468 (468.0 B)
>
> dummy0    Link encap:Ethernet  HWaddr 12:a8:13:88:24:29
>           inet6 addr: fe80::10a8:13ff:fe88:2429/64 Scope:Link
>           UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:0 (0.0 B)  TX bytes:280 (280.0 B)
>
> eth0      Link encap:Ethernet  HWaddr 00:30:48:db:31:00
>           inet addr:10.0.0.12  Bcast:10.0.0.255  Mask:255.255.255.0
>           inet6 addr: fe80::230:48ff:fedb:3100/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:994 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:481 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:103683 (101.2 KiB)  TX bytes:74826 (73.0 KiB)
>           Interrupt:16 Base address:0x4000
>
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>
> And the output of brctl show:
> bridge name     bridge id               STP enabled     interfaces
> br0             8000.12a813882429       no              dummy0
>
>
> Still, when I create the DomU, I get:
> eth0: ERROR while getting interface flags: No such device
> Failed to bring up eth0.
>
> (I didn't forget to restart the xend daemon.)
>
> I also noticed this:
> dmesg | grep -i eth
> [    0.000000] Kernel command line: root=/dev/hda1 ro
> ip=192.168.2.101:1.2.3.4:192.168.2.1:255.255.255.0:mx1:eth0:off
> console=hvc0 xencons=tty
> [    0.821870] netfront: Initialising virtual ethernet driver.
>
> Notice the "eth0:off"? Could this be of some importance? Hmmm...
> So then I added vif = ['bridge=br0'] to /etc/xen/mx1, destroyed &
> re-created and guess what... I can ping both ways now! W00t!
>
> Thank you for nudging me in the right direction. All the rest now is
> only a simple matter of setting up iptables on Dom0 for routing. and I'm
> done.

No problem.

You can still weed out some things in your dom0. The br0 device can be
used as a network interface by itself. There are two setups that are
common when using bridges. One setup assigns an ip address to the
bridge interface itself so your dom0 communicates with domU's trough
the br0 interface. The other setup doesn't assign an ip address to br0
but adds an dummy interface with an ip address, so your dom0
communicates with domU's trough the dummy0 interface.

Which one you choose is a matter of preference, the dummy setup gives
a clear distinction between bridges and network interfaces, while the
other setup gives less cluttering to your ifconfig list.

Your configuration seems to be a combination of the two, and the
dummy0 configuration seems to not have succeeded somehow (your dummy0
does not have the configured ip). So you could either remove the ip of
br0 and fix dummy0, or remove the interface dummy0. Also you don't
need the gateway entry in your dom0 config because dom0 is the
gateway.

Werner




More information about the ubuntu-users mailing list