Solved bhyve host and guest cannot reach out to each other

FreeBSD 14.1-RELEASE, installed Ubuntu VM both manually and via vm-bhyve (booted as UEFI). Now, I face the problem that bridged networking on the guest works just fine modulo a single issue:

I cannot ssh nor ping the guest and from the guest I'm able to ping any IP in the subnet besides the host's IP. I followed the standard procedures. Realtek USB dongle (ue0) + tap0 in the bridge0. To make it more interesting, same procedure just works on a different machine host withing the very same network. I hate the Realtek dongles, might that be an issue... for ARP related stuff etc?

Code:
$ ifconfig

ue0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
    options=280099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE,RXCSUM_IPV6>
    ether e2:01:50:74:ef:17
    inet 192.168.50.11 netmask 0xffffff00 broadcast 192.168.50.255
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
vm-public: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
    options=0
    ether 1e:08:5a:92:1d:0a
    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: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
           ifmaxaddr 0 port 4 priority 128 path cost 2000000
    member: ue0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
           ifmaxaddr 0 port 2 priority 128 path cost 20000
    groups: bridge vm-switch viid-4c918@
    nd6 options=9<PERFORMNUD,IFDISABLED>
tap0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
    description: vmnet/ubuntu/0/public
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:66:4c
    groups: tap vm-port
    media: Ethernet 1000baseT <full-duplex>
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    Opened by PID 10765

Code:
netstat -rnl4
Routing tables

Internet:
Destination        Gateway            Flags   Nhop#    Mtu      Netif Expire
default            192.168.50.1       UGS         5   1500        ue0
127.0.0.1          link#1             UH          1  16384        lo0
192.168.50.0/24    link#2             U           3   1500        ue0
192.168.50.11      link#1             UHS         4  16384        lo0

ue0 on the host has statically assigned the IP 192.168.50.11/24. I have stopped pf for the tests.
 
I think it makes sense... assuming that the guest is also on 192.168.50.0/24, then the host is routing packets to it out ue0. So you'll need to add a static route to the guest IP to go to tap0 (or maybe vm-public would work).

I think if you run tcpdump(1) on the host, you'll see ICMP packets coming in on tap0 and the responses going out ue0 which is wrong.
 
Back
Top