[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-misc
Subject:    tap vm network interfaces are not added to bridge/veb host interface
From:       Maksim Rodin <a23s4a2008 () yandex ! ru>
Date:       2022-12-25 14:11:11
Message-ID: 20221225141111.fjvjgrtnzurl7ewe () main ! rmaxv ! ru
[Download RAW message or body]

Hello.
Recently I tried to change my vmm network to using veb instead of
bridge.
I tried to do it as simple as possible and just renamed hostname.bridge0
to hostname.veb0, renamed hostname.vether0 to hostname.vport0, and
changed hostname.veb0 to include vport0 interface:
Here is the current network configuration on the host machine:
$ tail -n3 /etc/hostname.*
==> /etc/hostname.alc0 <==
inet autoconf

==> /etc/hostname.veb0 <==
add vport0
up

==> /etc/hostname.vport0 <==
inet 172.25.0.1 255.255.255.0
up

And here is the vmm configuration:
$ cat /etc/vm.conf
switch "vmm_switch" {
    interface veb0
}

vm "addc" {
	memory 4G
	disk "/DISK1/vmm/addc/disk0.img"
	interface { switch "vm_switch"
		lladdr fe:e1:ba:d3:57:48
		}
	owner vmowner
	disable
}

The only change in pf.conf is this:
# match out on egress from vether0:network to any nat-to (egress)
match out on egress from vport0:network to any nat-to (egress)

After that I could not access my vm by its network address anymore
though it was alive and accessible through the console.

After some investigation I found out that when I start the vm as vm
owner its tap0 interface is not automatically added to veb0 interface
as a child interface.

When I manually added tap0 interface to veb0 as a child, network connectivity was
back.

I tried to revert all the changes back to working with bridge but the tap
interface of the vm since that still needs manual addition to bridge interface as
well.
After every change like these I rebooted the host machine to make sure
nothing from the previous configuration is left behind but nothing has
changed in this behaviour.

Here is the ifconfig output when the vm is not started:
veb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST>
	description: switch1-vmm_switch
	index 4 llprio 3
	groups: veb
	vport0 flags=3<LEARNING,DISCOVER>
		port 5 ifpriority 0 ifcost 0
vport0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	lladdr fe:e1:ba:d0:aa:a8
	index 5 priority 0 llprio 3
	groups: vport
	inet 172.25.0.1 netmask 0xffffff00 broadcast 172.25.0.255

Here is the ifconfig output when the vm is running (no network access to
the vm):
veb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST>
	description: switch1-vmm_switch
	index 4 llprio 3
	groups: veb
	vport0 flags=3<LEARNING,DISCOVER>
		port 5 ifpriority 0 ifcost 0
vport0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	lladdr fe:e1:ba:d0:aa:a8
	index 5 priority 0 llprio 3
	groups: vport
	inet 172.25.0.1 netmask 0xffffff00 broadcast 172.25.0.255
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	lladdr fe:e1:ba:d3:3e:d8
	description: vm1-if0-addc
	index 9 priority 0 llprio 3
	groups: tap
	status: active

Here is the ifconfig output when I add tap0 to veb0 (network access to the
vm is ok):
veb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST>
	description: switch1-vmm_switch
	index 4 llprio 3
	groups: veb
	vport0 flags=3<LEARNING,DISCOVER>
		port 5 ifpriority 0 ifcost 0
	tap0 flags=3<LEARNING,DISCOVER>
		port 9 ifpriority 0 ifcost 0
vport0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	lladdr fe:e1:ba:d0:aa:a8
	index 5 priority 0 llprio 3
	groups: vport
	inet 172.25.0.1 netmask 0xffffff00 broadcast 172.25.0.255
tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	lladdr fe:e1:ba:d3:3e:d8
	description: vm1-if0-addc
	index 9 priority 0 llprio 3
	groups: tap
	status: active

My vmd host is OpenBSD 7.2 amd64 (which is used as a workstation as well if that matters).

Is there something I missed during changing network configuration from
bridge to veb and back again?

-- 
Maksim Rodin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic