bhyve Bhyve VM in localnetwork

Hello, I have a question. I would like to run a virtual machine in bhyve HomeAssistant OS.
However, I would like this virtual machine to be on the same subnet as the LAN network (hq0).

I used the following solution, but something is not working. The DHCP server is dnsmasq (the DHCP interface is set only to hq0):
Bash:
#vm switch create homebr

#vm switch add homebr hq0

#vm switch add homebr tap1 (HomeAssistant virtual machine interface)

I added to the vm configuration:

Code:
network0_type="virtio-net"
network0_switch="homebr"

Unfortunately, after restarting the VM, it does not want to retrieve an IP address from the hq0 subnet.
Has anyone done something similar and can suggest how to fix it?

Thanks


P.S.

I have manually set the addressing in the VM to use the hq0 subnet and I can ping the gateway and the internet, but I cannot ping this host from the internal hq0 network...
Code:
VM: 192.168.33.126
GW: 192.168.33.1
LAP: 192.168.33.105
ping VM > GW OK
ping GW > VM OK
ping VM > INTERNET OK
ping LAP > INTERNET OK
ping LAP > GW OK
ping VM > LAP NO RESPONSE
ping LAP > VM NO RESPONSE ;(

It seems that DHCP is not working for the virtual machine, and you are unable to retrieve an IP address.
 
Code:
#vm switch add homebr tap1 (HomeAssistant virtual machine interface)
Don't do this. It will be automatically added to the bridge when you start the VM. Just make sure network0_switch is set correctly in the VM's config.
 
Thank you for the suggestion. So, I removed tap1 from the switch. Now, after restarting the virtual machine, tap1 automatically added to this interface.
Bash:
#vm stop home-assistant
#vm switch remove homebr tap1
#vm start home-assistant

# ifconfig vm-homebr
vm-homebr: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 9e:ae:aa:8a:b7:9f
        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: tap1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 11 priority 128 path cost 2000000
        member: hq0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 3 priority 128 path cost 20000
        groups: bridge vm-switch viid-492d4@
        nd6 options=9<PERFORMNUD,IFDISABLED>
# ifconfig tap1
tap1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        description: vmnet/home-assistant/0/homebr
        options=80000<LINKSTATE>
        ether 58:9c:fc:10:ff:84
        groups: tap vm-port
        media: Ethernet autoselect
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        Opened by PID 53174


However, pings do not work at all now. Not even between the host and the guest.

P.S.
That's strange... After 5 minutes, the host started responding to pings but only from host and VPNs clients. I can't ping any host from network (192.168.33.0) only host (192.168.33.1)

P.S. 2
It works... i need to disable PF antispoof on hq0... Or someone have idea how to modify pf to get antispoof on hq0 and get working this bridge ?
 
Hello, I have a question. I would like to run a virtual machine in bhyve HomeAssistant OS.
However, I would like this virtual machine to be on the same subnet as the LAN network (hq0).

I used the following solution, but something is not working. The DHCP server is dnsmasq (the DHCP interface is set only to hq0):
Bash:
#vm switch create homebr

#vm switch add homebr hq0

#vm switch add homebr tap1 (HomeAssistant virtual machine interface)

I added to the vm configuration:

Code:
network0_type="virtio-net"
network0_switch="homebr"

Unfortunately, after restarting the VM, it does not want to retrieve an IP address from the hq0 subnet.
Has anyone done something similar and can suggest how to fix it?

Thanks


P.S.

I have manually set the addressing in the VM to use the hq0 subnet and I can ping the gateway and the internet, but I cannot ping this host from the internal hq0 network...
Code:
VM: 192.168.33.126
GW: 192.168.33.1
LAP: 192.168.33.105
ping VM > GW OK
ping GW > VM OK
ping VM > INTERNET OK
ping LAP > INTERNET OK
ping LAP > GW OK
ping VM > LAP NO RESPONSE
ping LAP > VM NO RESPONSE ;(

It seems that DHCP is not working for the virtual machine, and you are unable to retrieve an IP address.
Hi,
I created a bridge and than using vm create switch -t manual -b bridge1
(no need to add the interface vm switch add ....)
This solved my dhcp not working in the vm

In my case I had additinal nic which it was not in use.
cloned_interfaces="bridge1 tap0"
ifconfig_bridge1="addm em1 addm tap0 up"
ifconfig_em1="up"

once you create the vm check vm switch info and see that the new vm is attached correctly
 
Back
Top