# Bridging to VM is not working



## hardworkingnewbie (Sep 24, 2022)

Hi, 

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





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?


----------



## covacat (Sep 24, 2022)

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)


----------



## Emrion (Sep 24, 2022)

You should give some configuration information like those of this VM, /etc/rc.conf of the host and the output of `ifconfig`.


----------



## T-Daemon (Sep 24, 2022)

Try "Add net.link.bridge.pfil_onlyip 0 to sysctl tunables".

Source:





						Ethernet type pppoe inside of tap interface for vm bhyve
					

I create VM machine with freebsd on FreeNAS and want run inside vm PPPOE server. But tap interface can't see any packets of ether type  0x8863.  Where it can be ?  ifconfig  At HOST: ifconfig bridge2 bridge2: flags=8843 metric 0 mtu 9000         ether 02:a2:bf:XX:XX:XX         nd6 options=1...



					www.truenas.com


----------



## hardworkingnewbie (Sep 24, 2022)

T-Daemon said:


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


----------

