Bridged host and guest: worked until reboot [libvirt]
by GAVollink from LinuxQuestions.org on (#4QY47)
When I first set everything up it works fine. The guest can reach the router and the rest of my internal network. After the host reboots and bring the guest back up, the guest ends up with host-only access again. The following info is in the current state where the guest can only access the host.
Host is an Ubuntu Server 18.04 (upgraded from 16.04). /etc/network/interfaces setup. libvirt, KVM-QEMU.
Code:host$ virsh net-info kvmbr0
Name: kvmbr0
UUID: 90ef7bac-5cb3-4990-ba14-9cdd0746a1b1
Active: yes
Persistent: yes
Autostart: yes
Bridge: kvmbr0
host$ brctl show kvmbr0
bridge name bridge id STP enabled interfaces
kvmbr0 8000.3c4a92f484a4 no enp3s0f0
vnet0
host$ ifconfig kvmbr0
kvmbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.30 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::3e4a:92ff:fef4:84a4 prefixlen 64 scopeid 0x20<link>
ether 3c:4a:92:f4:88:12 txqueuelen 1000 (Ethernet)
RX packets 41312889 bytes 99498023958 (99.4 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12412270 bytes 93281634239 (93.2 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
host$ ping 192.168.1.1 # Router
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.443 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.383 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.362 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.385 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3058ms
rtt min/avg/max/mdev = 0.362/0.393/0.443/0.033 ms
host$ ping 192.168.1.39 # Guest
PING 192.168.1.39 (192.168.1.39) 56(84) bytes of data.
64 bytes from 192.168.1.39: icmp_seq=1 ttl=64 time=0.267 ms
64 bytes from 192.168.1.39: icmp_seq=2 ttl=64 time=0.339 ms
64 bytes from 192.168.1.39: icmp_seq=3 ttl=64 time=0.304 ms
64 bytes from 192.168.1.39: icmp_seq=4 ttl=64 time=0.278 ms
64 bytes from 192.168.1.39: icmp_seq=5 ttl=64 time=0.299 ms
^C
--- 192.168.1.39 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4083ms
rtt min/avg/max/mdev = 0.267/0.297/0.339/0.029 ms
$ virsh domiflist vm
Interface Type Source Model MAC
-------------------------------------------------------
vnet0 bridge kvmbr0 virtio 52:54:00:6e:b3:80This is JUST the interface section from virsh dumpxml for my vm...
Code: <interface type='bridge'>
<mac address='52:54:00:6e:b3:80'/>
<source network='kvmbr0' bridge='kvmbr0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>GUEST:
Code:vm:~$ ifconfig ens3
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.39 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::5054:ff:fe6e:b380 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:6e:b3:80 txqueuelen 1000 (Ethernet)
RX packets 29419 bytes 2539928 (2.5 MB)
RX errors 0 dropped 103 overruns 0 frame 0
TX packets 76375 bytes 5513396 (5.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vm:~$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
^C
--- 192.168.1.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4081ms
vm:~$ ping 192.168.1.30
PING 192.168.1.30 (192.168.1.30) 56(84) bytes of data.
64 bytes from 192.168.1.30: icmp_seq=1 ttl=64 time=0.316 ms
64 bytes from 192.168.1.30: icmp_seq=2 ttl=64 time=0.271 ms
64 bytes from 192.168.1.30: icmp_seq=3 ttl=64 time=0.276 ms
64 bytes from 192.168.1.30: icmp_seq=4 ttl=64 time=0.238 ms
64 bytes from 192.168.1.30: icmp_seq=5 ttl=64 time=0.437 ms
^C
--- 192.168.1.30 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4070ms
rtt min/avg/max/mdev = 0.238/0.307/0.437/0.071 msI feel like I'm missing something obvious, but I don't know what it is.


Host is an Ubuntu Server 18.04 (upgraded from 16.04). /etc/network/interfaces setup. libvirt, KVM-QEMU.
Code:host$ virsh net-info kvmbr0
Name: kvmbr0
UUID: 90ef7bac-5cb3-4990-ba14-9cdd0746a1b1
Active: yes
Persistent: yes
Autostart: yes
Bridge: kvmbr0
host$ brctl show kvmbr0
bridge name bridge id STP enabled interfaces
kvmbr0 8000.3c4a92f484a4 no enp3s0f0
vnet0
host$ ifconfig kvmbr0
kvmbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.30 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::3e4a:92ff:fef4:84a4 prefixlen 64 scopeid 0x20<link>
ether 3c:4a:92:f4:88:12 txqueuelen 1000 (Ethernet)
RX packets 41312889 bytes 99498023958 (99.4 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12412270 bytes 93281634239 (93.2 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
host$ ping 192.168.1.1 # Router
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.443 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.383 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.362 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.385 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3058ms
rtt min/avg/max/mdev = 0.362/0.393/0.443/0.033 ms
host$ ping 192.168.1.39 # Guest
PING 192.168.1.39 (192.168.1.39) 56(84) bytes of data.
64 bytes from 192.168.1.39: icmp_seq=1 ttl=64 time=0.267 ms
64 bytes from 192.168.1.39: icmp_seq=2 ttl=64 time=0.339 ms
64 bytes from 192.168.1.39: icmp_seq=3 ttl=64 time=0.304 ms
64 bytes from 192.168.1.39: icmp_seq=4 ttl=64 time=0.278 ms
64 bytes from 192.168.1.39: icmp_seq=5 ttl=64 time=0.299 ms
^C
--- 192.168.1.39 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4083ms
rtt min/avg/max/mdev = 0.267/0.297/0.339/0.029 ms
$ virsh domiflist vm
Interface Type Source Model MAC
-------------------------------------------------------
vnet0 bridge kvmbr0 virtio 52:54:00:6e:b3:80This is JUST the interface section from virsh dumpxml for my vm...
Code: <interface type='bridge'>
<mac address='52:54:00:6e:b3:80'/>
<source network='kvmbr0' bridge='kvmbr0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>GUEST:
Code:vm:~$ ifconfig ens3
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.39 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::5054:ff:fe6e:b380 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:6e:b3:80 txqueuelen 1000 (Ethernet)
RX packets 29419 bytes 2539928 (2.5 MB)
RX errors 0 dropped 103 overruns 0 frame 0
TX packets 76375 bytes 5513396 (5.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vm:~$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
^C
--- 192.168.1.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4081ms
vm:~$ ping 192.168.1.30
PING 192.168.1.30 (192.168.1.30) 56(84) bytes of data.
64 bytes from 192.168.1.30: icmp_seq=1 ttl=64 time=0.316 ms
64 bytes from 192.168.1.30: icmp_seq=2 ttl=64 time=0.271 ms
64 bytes from 192.168.1.30: icmp_seq=3 ttl=64 time=0.276 ms
64 bytes from 192.168.1.30: icmp_seq=4 ttl=64 time=0.238 ms
64 bytes from 192.168.1.30: icmp_seq=5 ttl=64 time=0.437 ms
^C
--- 192.168.1.30 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4070ms
rtt min/avg/max/mdev = 0.238/0.307/0.437/0.071 msI feel like I'm missing something obvious, but I don't know what it is.