I have a working setup with bhyve on FreeBSD13.1, with OpenBSD, Debian and Windows 10 VMs. With wired connectivity thru em0, everything is up and running thru their bridge (named public below):
# ifconfig
I had to move the PC away from the wired setup and use wifi, so changed the settings of the bhyve bridge to use wlan0 instwed of em0. First I decided to make it with adding wlan0 next to em0 -> vm switch add public wlan0 - not working.
Then I removed the whole "public" bridge and created it from scratch with just the wlan0 on ports - not working. The virtual machines can ping their host machine IP, but not the gateway on .1 thru the wireless. Also no internet connectivity from any of the VMs.
Then I followed https://forums.freebsd.org/threads/vm-bhyve-share-wlan0-with-archlinux.73926/ and added the network address instead of the interface as suggested in the post - no luck.
Moved back the PC on cable and added back the em0 to the bridge - all up and running.
Tried to assign IP address on tap0 so I can make a NAT thru pf.conf: nat on wlan0 from tap0 to any -> wlan0 - not working. Tried to nat the vm-public bridge with the -a 192.168.3.0/24 and without it, with wlan0 - also not working.
Has anyone made it work with wifi, and how?
I wonder what's breaking with the wifi so it is not working at all?
# ifconfig
Code:
em0: flags=8963<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=4812099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,VLAN_HWFILTER,NOMAP>
ether 18:03:73:1e:b2:eb
inet 192.168.3.115 netmask 0xffffff00 broadcast 192.168.3.255
inet 192.168.3.116 netmask 0xffffff00 broadcast 192.168.3.255
inet 192.168.3.117 netmask 0xffffff00 broadcast 192.168.3.255
inet 192.168.3.118 netmask 0xffffff00 broadcast 192.168.3.255
inet 192.168.3.119 netmask 0xffffff00 broadcast 192.168.3.255
inet 192.168.3.120 netmask 0xffffff00 broadcast 192.168.3.255
inet 192.168.3.121 netmask 0xffffff00 broadcast 192.168.3.255
inet 192.168.3.122 netmask 0xffffff00 broadcast 192.168.3.255
inet 192.168.3.123 netmask 0xffffff00 broadcast 192.168.3.255
inet 192.168.3.124 netmask 0xffffff00 broadcast 192.168.3.255
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 5c:a6:e6:c3:2c:38
inet 192.168.3.116 netmask 0xffffff00 broadcast 192.168.3.255
groups: wlan
ssid 2DidoB channel 6 (2437 MHz 11g ht/20) bssid e0:63:da:3d:7c:4d
regdomain ETSI country BG authmode WPA2/802.11i privacy ON
deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60
protmode CTS ht20 ampdulimit 64k ampdudensity 8 shortgi -stbc -ldpc
-uapsd wme roaming MANUAL
parent interface: rtwn0
media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
status: associated
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
vm-public: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 5e:82:0c:b6:69:e4
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
member: tap2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 7 priority 128 path cost 2000000
member: tap1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 6 priority 128 path cost 2000000
member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 5 priority 128 path cost 2000000
member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 1 priority 128 path cost 20000
groups: bridge vm-switch viid-4c918@
nd6 options=9<PERFORMNUD,IFDISABLED>
tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: vmnet/obsd-bastion/0/public
options=80000<LINKSTATE>
ether 58:9c:fc:10:d6:1d
groups: tap vm-port
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Opened by PID 1617
tap1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: vmnet/openbsd72/0/public
options=80000<LINKSTATE>
ether 58:9c:fc:10:19:26
groups: tap vm-port
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Opened by PID 1879
tap2: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: vmnet/windows10/0/public
options=80000<LINKSTATE>
ether 58:9c:fc:10:ff:86
groups: tap vm-port
media: Ethernet autoselect
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Opened by PID 4345
I had to move the PC away from the wired setup and use wifi, so changed the settings of the bhyve bridge to use wlan0 instwed of em0. First I decided to make it with adding wlan0 next to em0 -> vm switch add public wlan0 - not working.
Then I removed the whole "public" bridge and created it from scratch with just the wlan0 on ports - not working. The virtual machines can ping their host machine IP, but not the gateway on .1 thru the wireless. Also no internet connectivity from any of the VMs.
Then I followed https://forums.freebsd.org/threads/vm-bhyve-share-wlan0-with-archlinux.73926/ and added the network address instead of the interface as suggested in the post - no luck.
Moved back the PC on cable and added back the em0 to the bridge - all up and running.
Code:
vm switch list
NAME TYPE IFACE ADDRESS PRIVATE MTU VLAN PORTS
public standard vm-public - no - - em0
Tried to assign IP address on tap0 so I can make a NAT thru pf.conf: nat on wlan0 from tap0 to any -> wlan0 - not working. Tried to nat the vm-public bridge with the -a 192.168.3.0/24 and without it, with wlan0 - also not working.
Has anyone made it work with wifi, and how?
I wonder what's breaking with the wifi so it is not working at all?