0

I run a Ubuntu machine which hosts via libvirt several guest VMs (also Ubuntu). The guests can access the Internet, while the host can only reach the local network, including the gateway. This seems weird and I have no clue as to what may be the root cause.

I cannot recall where along the line this problem occurred first or which change triggered it. So I just describe the current situation in terms of some config and output:

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         a.b.c.1    0.0.0.0         UG    0      0        0 eth0
a.b.c.0    0.0.0.0         255.255.255.0   U     0      0        0 br0
a.b.c.0    0.0.0.0         255.255.255.0   U     1      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 br0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0

This seems to say basically the same:

$ ip route show
default via a.b.c.1 dev eth0  proto static 
a.b.c.0/24 dev br0  scope link 
a.b.c.0/24 dev eth0  proto kernel  scope link  src a.b.c.38  metric 1 
169.254.0.0/16 dev br0  scope link  metric 1000 
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1 

/etc/network/interfaces :

auto lo
iface lo inet loopback

auto br0 
iface br0 inet static
    address a.b.c.38
    netmask 255.255.255.0
    network a.b.c.0
    broadcast a.b.c.255
    gateway a.b.c.1
    dns-nameserver XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX
    bridge_ports all
    bridge_stp yes
    bridge_fd 0
    post-up /sbin/ethtool -s eth0 wol g
    post-down /sbin/ethtool -s eth0 wol g

This command fails:

$ sudo ifdown eth0 && sudo ifup eth0
ifdown: interface eth0 not configured
Ignoring unknown interface eth0=eth0.   

Another command concerning the bridge:

$ brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.14dae9726e93       no              eth0
                                                        vnet0
                                                        vnet1
                                                        vnet2
virbr0          8000.000000000000       yes

This seems suspicious:

$ arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
a.b.c.50                    (incomplete)                              eth0
a.b.c.63                    (incomplete)                              eth0
a.b.c.1             ether   00:00:0c:07:ac:3d   C                     br0
a.b.c.63            ether   4c:72:b9:8f:b8:6c   C                     br0
a.b.c.50                    (incomplete)                              br0
a.b.c.40            ether   52:54:00:2f:79:ac   C                     br0
a.b.c.39            ether   00:25:90:7c:f8:94   C                     br0
a.b.c.1                     (incomplete)                              eth0
a.b.c.48            ether   3c:07:54:13:7c:55   C                     br0
a.b.c.2             ether   f0:f7:55:2a:15:00   C                     br0

2 Answers 2

0

To start with, /etc/network/interfaces defines a br0 interface but not an eth0 interface, so you would of course expect ifup eth0 to fail. You could try to ifdown br0; ifup br0. You would expect to see the default route on your system going out br0 and not eth0, given your configuration.

eth0 should not have any ip address assigned.

Note that bringing the bridge down and up may interrupt internet access from your virtual machines such that they need to be restarted (I'm not sure if it will or not but I'm not able to test that at the moment).

2
  • 1
    It does not seem that eth0 must be in /etc/network/interfaces. For example, this guide does explicitly remove it from the file: link
    – Lutz
    Aug 27, 2015 at 8:10
  • I didn't suggest that you should add eth0 to /etc/network/interfaces. I was just pointing out that you can't run ifup eth0 if it's not there. The link you provided in your comment provides you with essentially the same instructions as I did in this answer -- you have to operate on br0 instead.
    – larsks
    Aug 27, 2015 at 11:46
0

There seems to have been an outside cause. The switched network was configured in a way that does not run the STP (Spanning Tree Protocol) and therefor disconnects ports that send STP packets. In the network config bridge_stp yes led to sending theses packets. However, it is unclear how the VM guests could still communicate with the outer Internet. Anyway, the problem is now solved - thanks!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .