Need a bhyve VM or a jail to use my existing wireguard connection on host

I was following a manual from here :https://github.com/churchers/vm-bhyve


Instead of the suggested step:
vm switch add public em0

I tried
vm switch add public wg0
.. and I cannot. The message I get is
Code:
/usr/local/sbin/vm: ERROR: failed to add member wg0 to the virtual switch public

Since wg0 is already not a physical adapter , rather a virtual one, how do I get a VM to use it?
Do I clone it or create an epair?
I am relying upon bhyve since I was unable to do the same using jails as well.

I do not want to go back to virtualbox which just seamlessly works and will happily create a NAT and will use my host's wg0.
 
Don't bridge it and use 'standard' routing on the host to route the traffic from the VM through the VPN tunnel?

Since wg0 is already not a physical adapter
That has nothing to do with it. A bridge(4) operates on layer 2, the wireguard tunnel interface (wg0) is at layer 3, it has no layer 2. You could use gre(4) on top of the wireguard tunnel and bridge that if you really need layer 2 bridging. But this adds quite a bit of complexity.
 
Back
Top