3

How do I get Xen domU guests to have internet access? What tools can I use to diagnose the problem? Are there log files I can examine?

(I'm new linux and networking and VMs. Please execuse me if I get the terminology wrong. Also I'm not sure which / how much information to provide.)

I have installed a Xen hypervisor on an Oracle VirtualBox. The (Debian) dom0 (hostname=debianxend0) has internet access, i.e. I can use apt-get to download packages and ping www.google.com works.

Using xen-create-image I installed a domU (hostname=tutorial-pv-guest).

The domU guests can ping and ssh dom0 but not the outside, i.e. ping www.google.com fails. dom0 can ping and ssh domU

dom0 /etc/network/interfaces

 auto lo
 iface lo inet loopback

 auto xenbr0
 iface xenbr0 inet dhcp
  bridge_ports eth0
  bridge_stp on
  bridge_waitport 0
  bridge_fd 0

dom0 ifconfig -a

eth0      Link encap:Ethernet  HWaddr 08:00:27:76:ba:6f  
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:3445 errors:0 dropped:0 overruns:0 frame:0
      TX packets:675 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:936784 (914.8 KiB)  TX bytes:63581 (62.0 KiB)

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)

vif2.0    Link encap:Ethernet  HWaddr fe:ff:ff:ff:ff:ff  
      inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:20 errors:0 dropped:0 overruns:0 frame:0
      TX packets:398 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:32 
      RX bytes:1376 (1.3 KiB)  TX bytes:55771 (54.4 KiB)

xenbr0    Link encap:Ethernet  HWaddr 08:00:27:76:ba:6f  
      inet addr:192.168.178.57  Bcast:192.168.178.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fe76:ba6f/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1680 errors:0 dropped:0 overruns:0 frame:0
      TX packets:222 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:230914 (225.5 KiB)  TX bytes:38211 (37.3 KiB)

dom0 brctl show

bridge name         bridge id       STP enabled interfaces
xenbr0      8000.08002776ba6f   yes     eth0
                                vif2.0

domU /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

domU ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:16:3e:8b:54:20  
      inet addr:192.168.178.232  Bcast:192.168.178.255  Mask:255.255.255.0
      inet6 addr: fe80::216:3eff:fe8b:5420/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:995 errors:0 dropped:0 overruns:0 frame:0
      TX packets:207 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:104718 (102.2 KiB)  TX bytes:27230 (26.5 KiB)
      Interrupt:30 

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:554 (554.0 B)  TX bytes:554 (554.0 B)
  • dom0 has a bridge with an IP addressed assigned by DHCP (I live in a residence, they provide a WLAN which provides the IP addresses).
  • dom0 has a vif2.0 for domU
  • domU has an eth0 with an IP address

And below is the xen cfg for domU

bootloader = '/usr/lib/xen-4.1/bin/pygrub'
vcpus       = '2'
memory      = '512'
root        = '/dev/xvda2 ro'
disk        = [
              'phy:/dev/vg0/tutorial-pv-guest-disk,xvda2,w',
              'phy:/dev/vg0/tutorial-pv-guest-swap,xvda1,w',
          ]
name        = 'tutorial-pv-guest'
dhcp        = 'dhcp'
vif         = [ 'mac=00:16:3E:8B:54:20,bridge=xenbr0' ]
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'
robor
  • 143

1 Answers1

2

The issue is with MAC address authentication. WiFi only allows packets from authenicated MAC addresses, which is why you can't bridge a wired and wireless connection so easily. If it's not because of a wireless issue, it's because of some other form of MAC barrier set up by whomever is managing the network there (which is why they asked for your MAC address).

One strategy may be to simply change the MAC address of your guests' virtual adapters to that of your physical one. Disclaimer: I haven't tried this before, tell me if it works :)

If that doesn't work, you'll need to make another local network and use NAT to pass traffic out from a single IP/MAC address (like in comment).

There are guides for "bridging" wired connections through wireless, and these solutions should work for you even if you're not actually on wireless. Most probably refer to the NAT method.