1

We have installed a Xen (4.1) configuration and can't get Dom0 and the DomUs to communicate (ping eachother). The DomUs are able to ping eachother but not Dom0, and Dom0 cannot ping the DomUs. We tried a lot of different things following what we could find on the net, including some solution that had been proposed on this website (see below), but we are stuck...

Here is our configuration: we have two guest domains:

  • VM1, with ID 3
  • test2, with ID 4

We are trying to link them in a bridge way, like in http://wiki.xen.org/wiki/XenNetworking#Bridging, but we didn't succeed to do that.

Here are the ifconfigs:

From Dom0:

# ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:26:22:45:33:59  
          UP BROADCAST MULTICAST  MTU:1500  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:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B) 
          Interrupt:35 Base address:0xc000 

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:460 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:460 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:0 
          RX bytes:35512 (35.5 KB)  TX bytes:35512 (35.5 KB) 

lxcbr0    Link encap:Ethernet  HWaddr 9a:b8:f4:95:9f:36  
          inet addr:10.0.3.1  Bcast:10.0.3.255  Mask:255.255.255.0 
          inet6 addr: fe80::98b8:f4ff:fe95:9f36/64 Scope:Link 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:10287 (10.2 KB) 

wlan0     Link encap:Ethernet  HWaddr 70:1a:04:0d:09:74  
          inet6 addr: fe80::721a:4ff:fe0d:974/64 Scope:Link 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1 
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:66 (66.0 B)  TX bytes:0 (0.0 B) 

xenbr0    Link encap:Ethernet  HWaddr 00:26:22:45:33:59  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0 
          UP BROADCAST MULTICAST  MTU:1500  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) 

From VM1:

VM1:~# ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:16:3E:22:99:77  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0 
          inet6 addr: fe80::216:3eff:fe22:9977/64 Scope:Link 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
          RX packets:1478 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:71 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:286514 (279.7 KiB)  TX bytes:5330 (5.2 KiB) 
          Interrupt:26 

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:15 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:0 
          RX bytes:1680 (1.6 KiB)  TX bytes:1680 (1.6 KiB) 

From test2:

test2:~# ifconfig  
eth0      Link encap:Ethernet  HWaddr 00:16:3E:6A:81:FF  
          inet addr:192.168.1.203  Bcast:192.168.1.255  Mask:255.255.255.0 
          inet6 addr: fe80::216:3eff:fe6a:81ff/64 Scope:Link 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
          RX packets:1278 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:56 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:242526 (236.8 KiB)  TX bytes:4488 (4.3 KiB) 
          Interrupt:26 

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:6 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:672 (672.0 b)  TX bytes:672 (672.0 b)

Here is also our /etc/network/interfaces:

auto lo 
iface lo inet loopback 

auto xenbr0
iface xenbr0 inet static 
        bridge_ports eth0 
        address 192.168.1.1 
        broadcast 192.168.1.255 
        netmask 255.255.255.0 
        gateway 192.168.1.0 

auto eth0 
iface eth0 inet manual

And here are the result of the command "brctl show", from Dom0:

# brctl show 
bridge name bridge id       STP enabled interfaces 
lxcbr0      8000.feffffffffff   no      vif3.0 
                                        vif4.0 
xenbr0      8000.002622453359   no      eth0 

What we tried so far:

  • giving an IP address to eth0 of Dom0:

    ifconfig eth0 192.168.1.1 netmask 255.255.255.0

  • we tried to follow this answer Network Bridge in dom0 can not ping domU's but we have no interface eth1, and no interface would work.

Any suggestion, help?


Thanks for the answers, the brctl addif ... does not work.

Here is the configuration file of VM1:

kernel      = '/boot/vmlinuz-3.2.0-33-generic'
ramdisk     = '/boot/initrd.img-3.2.0-33-generic'

vcpus       = '1'
memory      = '128'

#
#  Disk device(s).
#
root        = '/dev/xvda2 ro'
disk        = [
                  'file:/home/xen/domains/VM1/disk.img,xvda2,w',
                  'file:/home/xen/domains/VM1/swap.img,xvda1,w',
              ]


#
#  Physical volumes
#


#
#  Hostname
#
name        = 'VM1'

#
#  Networking
#
vif         = [ 'ip=192.168.1.2,mac=00:16:3E:22:99:77' ]

#
#  Behaviour
#
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'
  • Please provide the Xen config file for either of the DomU's. From the looks of brctl, vif3.0 and vif4.0 which correspond to DomU ID 3 and 4 (respectively) are added to the lxcbr0 bridge. – Bort Dec 12 '12 at 19:50
  • Did you figure out why this is not working? Same problem here. – Wakan Tanka Apr 27 '15 at 10:33
1

Oh my, so old... But since I got here while trying to find a solution, here's one. I think your problem is in "ip=192.168.1.2" at your vif line, but if I'm wrong, the answer is useless. And even if I'm right, it's useless for people with even slightly different config. Therefore, long version:

DomU network config (everything else doesn't matter): vif=['bridge=xenbr0']

Bridge is configured over the dummy interface, made up like this (these are commands executed as root):

# modprobe dummy
# ifconfig dummy0 up
# brctl addbr xenbr0
# brctl addif xenbr0 dummy0

Here's how it looks after you start your VM (you can see VM's vif16.0 attached to your bridge):

# brctl show
bridge name     bridge id               STP enabled     interfaces
xenbr0          8000.1a088b6b402f       no              dummy0
                                                        vif16.0

I use DHCP, but you could assign IP's manually. To xenbr0 for Dom0 and eth0 under DomU for DomU. Do not assign any IPs to your bridge members! This is important.

ifconfig for Dom0 looks like this (removed stats to make it less bulky):

dummy0    Link encap:Ethernet  HWaddr 1a:08:8b:6b:40:2f
          inet6 addr: fe80::1808:8bff:fe6b:402f/64 Scope:Link
          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1

vif16.0   Link encap:Ethernet  HWaddr fe:ff:ff:ff:ff:ff
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

xenbr0    Link encap:Ethernet  HWaddr 1a:08:8b:6b:40:2f
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::1808:8bff:fe6b:402f/64 Scope:Link

And from DomU looks like this:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.2.21  netmask 255.255.255.0  broadcast 192.168.2.255
    inet6 fe80::216:3eff:fe25:e843  prefixlen 64  scopeid 0x20<link>

Pinging Dom0:

PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.238 ms
64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=0.279 ms

And for internet access (my configuration is essentially NAT, yours should have internet access natively) enabling NAT may be required like this:

iptables -t nat -A POSTROUTING -s 192.168.2.0/24 ! -d 192.168.2.0/24 -j MASQUERADE

For troubleshooting use tcpdump -v -i xenbr0. It helps a lot as successful Ping requires your packet to get out and return, therefore gives you no clue about when it is lost - while getting out or coming back.

0

Your configuration file does not specify the bridge to connect your DomU's to. You can specify the bridge in the vif stanza:

vif = [ 'mac=00:16:3E:22:99:77,bridge=xenbr0' ]

You may also specify the IP address and other information. See Xen Configuration Options.

Specifying the bridge in the vif stanza causes Xen to run a script on the Dom0 after the DomU is assigned virtual interfaces. This adds the virtual interface to the specified bridge.

Please note it may take additional adjustments to your network setup to get this to work. Using the correct Xen config options will help simplify the rest.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.