Route all VM traffic through Tor

Is it feasible to create a bhyve VM that routes all traffic through Tor on the host? My bhyve config has bridge0 with a tap0 and wireless interface wlan0 added to the bridge. The VM has internet through tap0 with pf`NAT rules. But I'm unsure how I would adapt it for tor traffic:

/etc/rc.conf
Code:
cloned_interfaces="bridge0 tap0"
ifconfig_bridge0="addm wlan0 172.16.0.1/24 up addm tap0"
kld_list="nmdm vmm"

gateway_enable="yes"
pf_enable="YES"
pflog_enable="YES"

/etc/sysctl.conf
Code:
net.link.tap.up_on_open=1

/etc/pf.conf
Code:
ext_if="wlan0"
int_if="lo1"
vm_if="tap0"
localnet=$int_if:network

scrub in all fragment reassemble
set skip on lo0
set skip on lo1

#nat for bhyve
nat on $ext_if inet from {172.16.0.0/24} to any -> ($ext_if)
 
Back
Top