Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 May 2023 22:50:18 +0200
From:      Tomek CEDRO <tomek@cedro.info>
To:        Steven Friedrich <freebsdlouisville@gmail.com>
Cc:        FreeBSD Questions Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: no traffic from guest to host. guest can't get a dhcp response. ping says no route to host.
Message-ID:  <CAFYkXjnXwUQ6nL2PDUHjedcL3zoDbY0KEBFvrDQNc3_Dc0j9ag@mail.gmail.com>
In-Reply-To: <4f1f9f93-47c2-6be9-b6dd-bcfd7e27a29f@Gmail.com>
References:  <85ca379a-830d-897a-c2ed-240c9aca687a@Gmail.com> <CAFYkXjm=3rh5GK8rwJDziQLxN0jO7qk8VWx_ea80jJG5VwNfWA@mail.gmail.com> <4f1f9f93-47c2-6be9-b6dd-bcfd7e27a29f@Gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, May 7, 2023 at 5:44=E2=80=AFAM Steven Friedrich wrote:
> In my /etc/rc.conf, i have:
> cloned_interfaces=3D"bridge0"
> ifconfig_bridge0=3D"addm re0"
> where re0 is my network adapter on my host.
> Are your lines the same?

My rc.conf only has this part of vm-bhyve:

vm_enable=3D"YES"
vm_dir=3D"zfs:zroot/ztuff/vm/bhyve"

Do not use rc.conf for vm-bhyve network configuration. The vm-bhyve
configuration is stored under $vm_dir/.config/system.conf and mine is:

switch_list=3D"public"
type_public=3D"standard"
ports_public=3D"em3"
private_public=3D"no"

This gives me network interface under vm. However, I use ipfw firewall
in workstation mode that has quite strict filtering, this also affects
vm network traffic, in rc.conf it is represented by:

firewall_enable=3D"YES"
firewall_type=3D"workstation"

This is why I also need to disable packet filtering for bridge
interfaces with these lines in /etc/sysctl.conf:

sysctl net.link.bridge.ipfw=3D0
sysctl net.link.bridge.pfil_bridge=3D0
sysctl net.link.bridge.pfil_member=3D0

And this gives me packet moving also from/into the vm network.

If you want to know meaning of the specific sysctl use -d switch:

% sysctl -d sysctl net.link.bridge.ipfw
sysctl: Sysctl internal magic
sysctl.name:
sysctl.next:
sysctl.name2oid:
sysctl.oidfmt:
sysctl.oiddescr:
sysctl.oidlabel:
sysctl.nextnoskip:
net.link.bridge.ipfw: Layer2 filter with IPFW

% sysctl -d sysctl net.link.bridge.pfil_bridge
sysctl: Sysctl internal magic
sysctl.name:
sysctl.next:
sysctl.name2oid:
sysctl.oidfmt:
sysctl.oiddescr:
sysctl.oidlabel:
sysctl.nextnoskip:
net.link.bridge.pfil_bridge: Packet filter on the bridge interface

% sysctl -d sysctl net.link.bridge.pfil_member
sysctl: Sysctl internal magic
sysctl.name:
sysctl.next:
sysctl.name2oid:
sysctl.oidfmt:
sysctl.oiddescr:
sysctl.oidlabel:
sysctl.nextnoskip:
net.link.bridge.pfil_member: Packet filter on the member interface

I had to clean all configuration and restart from start several times
at first until I got this working. Focus on the `man vm` and perform
steps described from start (description, basic setup, zfs, quickstart)
until things are working :-)

Hope that helps :-)

--=20
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXjnXwUQ6nL2PDUHjedcL3zoDbY0KEBFvrDQNc3_Dc0j9ag>