Bridging to VM is not working

Hi,

I have got the following small and simple setup at home in place:

1664005463518.png

As you can see nothing fancy: a dedicated DSL modem, which runs in bridge mode connected to a small router box where FreeBSD 13.1 runs on bare metal. This has two NICs, one connected to the modem and using PPPoE there, the other one to the internal hub and does the usual stuff: packet filter, NAT, traffic monitoring, DHCP etc.

This setup is working without problems since months and stable.

Now I wanted for testing purposes to put another FreeBSD into bhyve, and let that bhyve VM handle this stuff instead. In short I want to virtualize my firewall. I created the VM via vm-bhyve, and added two virtual interfaces: vtnet0 points to re0, and is the public vm-switch while vtnet1 points to re1 and is the internal vm-switch.

Of course, putting FreeBSD in the VM does work, no problem. But after setting it up then only the internal network is reachable for the VM, meaning I can SSH to it, do all stuff it should do. The vtnet0 device pointing to the DSL modem seems to be dead; also used tcpdump on the host side to monitor it, nothing PPPoE like makes it ever through.

So question is for me now: why is that so? Why does it not work in a VM, where it does on bare metal? I seem to vaguely remember that for that to work I need to disable something like hardware offloading or so on the vtnet driver, has anybody some clues for how to get this above into working condiction from inside bhyve?
 
put some ip on vtnet0 and ping something in that subnet from the vm
see if you can see the packets on the host re0 or tap0 (arp requests)
 
You should give some configuration information like those of this VM, /etc/rc.conf of the host and the output of ifconfig.
 
Try "Add net.link.bridge.pfil_onlyip 0 to sysctl tunables".

Source:
Thanks, that was the missing part, changing this tunable immediately solved my problem.
 
Back
Top