0

I'm working on debian stretch with the newest xen from repositories. I've never worked with xen before, so bare with me. I've searched far and wide, and all solutions I apply do not work.

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).

Anything you guys can help me with? Thanks in advance!

EDIT 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.

  • 1
    it isn't necessary to add solved to your question, it is marked as solved when you accept an answer. – Gerald Schneider Aug 17 '18 at 7:19
0

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.

  • I've outcommented the second configuration, and put the one you posted. service networking restart comes with an error, unfortunately – OH MY DEAR PUFFINS Aug 16 '18 at 7:02
  • Apparently, having both configurations work (after having made the same or similar configurations for the twentieth time), but now the guest will not connect to any network. Host works exactly like I want it to, though. Do I have to configure the guest /etc/network/interfaces also, to something else? – OH MY DEAR PUFFINS Aug 16 '18 at 7:23
  • I see no error here? – Michael Hampton Aug 16 '18 at 13:06
  • May bad. I had to configure the guest's interfaces file. – OH MY DEAR PUFFINS Aug 17 '18 at 6:35
0

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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