1

I'm working on Debian stretch with the newest xen from repositories.

Installing xen-system and xen-tools gave no errors, though when I try to start a guest (we'll call it dom1) it won't work unless I create a bridge. I create a bridge with brctl and call it xenbr0, and link it to the main interface (it's called eno1 on my server).

Starting dom1 now works, but there is no connection to any network, not even the LAN, neither from host nor guest. No response from the server either, if I try to ping it from a different device.

/etc/network/interfaces (after having followed the latest guide I could find):

auto lo
iface lo inet loopback

#xen
auto xenbr0
iface xenbr0 inet static
    address 192.168.0.201
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.1
    dns-nameservers 192.168.0.1 8.8.8.8 4.4.2.2
    dns-search google.com

#The primary network interface
auto eno1
iface eno1 inet manual

I don't know what I haven't tried. I've edited /etc/xen-tools/xen-tools.conf, /etc/xen/xl.conf, resolv.conf, and /etc/network/interfaces all according to every guide I could find (of course having gone back to the default configurations at first).

I edited /etc/network/interfaces to:

allow-hotplug eno1
iface eno1 inet static
    bridge_ports xenbr0
    address 192.168.0.201
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.1

Now, when I DON'T create a bridge, I can connect to the internet. Once I create a bridge, the same problem occurs: neither host nor guest can connect to any network, and neither can a device on the network ping the host or guest.

Flimzy
  • 2,454
  • 18
  • 26

2 Answers2

2

Your bridge configuration is missing bridge_ports, to tell which physical network interfaces should be part of the bridge.

For example:

auto xenbr0
iface xenbr0 inet static
    bridge_ports eno1
    address 192.168.0.201
    ....

The second configuration you posted does not configure a bridge.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
1

All thanks to @michael-hampton, I was lead to the right direction; thanks for that. Your answer will be seen as the one that solved it. Below is what I did. It's very simple, (I say after at least 50 tries). Change /etc/network/interfaces. You have to configure both your main interface as well as the bridge. Here's what my interfaces file looks like:

allow-hotplug eno1
iface eno1 inet static
    bridge_ports xenbr0
    address 192.168.0.201
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.1

auto xenbr0
iface xenbr0 inet static
    bridge_ports eno1
    address 192.168.42.201
    netmask 255.255.255.0
    network 192.168.42.0
    broadcast 192.168.42.255
    gateway 192.168.42.1

After having configured the interfaces, run service networking restart (or reboot just to make sure). To check everything went as planned, run ifconfig or ip addr show, to see if everything is configured properly. The main interface should have an IP address, as well as the bridge. You can check if it works by pinging to the gateway or to some website, to make double sure.

When that is done, you have to configure /etc/network/interfaces on guests. I just copied the configuration from the host, to the main interface of the guest with some tweaks (change eno1 to eth0 and IP address in my case):

allow-hotplug eth0
iface eth0 inet static 
    address 192.168.0.203
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.1

On the guest, run service networking restart, or shut it down and start it again, and you should now have a working connection on both host and guest.

Again, all thanks to Michael Hampton!