I'm trying to setup some bhyve guests for the first time on my 13.0-RELEASE system but the guests were unable to obtain IP addresses from the DHCP server on my router unless I disabled ipfw. It appears that ipfw was blocking the responses from the DHCP server.
Google searches didn't come up with any solutions for me although one article relating to a somewhat different problem suggested changing sysctl net.link.bridge.ipfw. As an experiment I tried setting this to 1 and found that with ipfw running DHCP worked for the FreeBSD and Windows guests I'd created. But I know nothing about the significance of this sysctl setting and I'm wary of blindly changing things like this in case I'm introducing problems elsewhere.
So did I do the right thing or should I have set up some additional ipfw rules ?
Google searches didn't come up with any solutions for me although one article relating to a somewhat different problem suggested changing sysctl net.link.bridge.ipfw. As an experiment I tried setting this to 1 and found that with ipfw running DHCP worked for the FreeBSD and Windows guests I'd created. But I know nothing about the significance of this sysctl setting and I'm wary of blindly changing things like this in case I'm introducing problems elsewhere.
So did I do the right thing or should I have set up some additional ipfw rules ?
Code:
curlew:/root# uname -a
FreeBSD curlew 13.0-RELEASE-p11 FreeBSD 13.0-RELEASE-p11 #0: Tue Apr 5 18:54:35 UTC 2022 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
curlew:/root# ifconfig
re0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=82099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
ether 40:8d:5c:84:3d:74
inet 192.168.1.13 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe80::428d:5cff:fe84:3d74%re0 prefixlen 64 scopeid 0x1
inet6 2a02:8010:6418:0:428d:5cff:fe84:3d74 prefixlen 64 autoconf
inet6 2a02:8010:6418:0:3c54:1293:7650:d114 prefixlen 64 autoconf temporary
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,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>
vm-public: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 0a:cc:49:c4:20:81
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: re0 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-freebsd131-0-public
options=80000<LINKSTATE>
ether 58:9c:fc:10:e4:65
groups: tap vm-port
media: Ethernet autoselect
status: active
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
Opened by PID 5631
curlew:/root# ipfw list
00100 allow ip from any to any via lo0
00200 deny ip from any to 127.0.0.0/8
00300 deny ip from 127.0.0.0/8 to any
00400 deny ip from any to ::1
00500 deny ip from ::1 to any
00600 allow ipv6-icmp from :: to ff02::/16
00700 allow ipv6-icmp from fe80::/10 to fe80::/10
00800 allow ipv6-icmp from fe80::/10 to ff02::/16
00900 allow ipv6-icmp from any to any icmp6types 1
01000 allow ipv6-icmp from any to any icmp6types 2,135,136
01100 check-state :default
01200 allow tcp from me to any established
01300 allow tcp from me to any setup keep-state :default
01400 allow udp from me to any keep-state :default
01500 allow icmp from me to any keep-state :default
01600 allow ipv6-icmp from me to any keep-state :default
01700 allow udp from 0.0.0.0 68 to 255.255.255.255 67 out
01800 allow udp from any 67 to me 68 in
01900 allow udp from any 67 to 255.255.255.255 68 in
02000 allow udp from fe80::/10 to me 546 in
02100 allow icmp from any to any icmptypes 8
02200 allow ipv6-icmp from any to any icmp6types 128,129
02300 allow icmp from any to any icmptypes 3,4,11
02400 allow ipv6-icmp from any to any icmp6types 3
02500 allow tcp from 192.168.1.0/24{1-199} to me 22 keep-state :default
02600 allow tcp from 192.168.1.0/24{1-199} to me 80 keep-state :default
02700 allow tcp from 192.168.1.0/24{1-199} to me 81 keep-state :default
02800 allow tcp from 192.168.1.0/24{1-199} to me 137 keep-state :default
02900 allow tcp from 192.168.1.0/24{1-199} to me 138 keep-state :default
03000 allow tcp from 192.168.1.0/24{1-199} to me 139 keep-state :default
03100 allow tcp from 192.168.1.0/24{1-199} to me 445 keep-state :default
03200 allow tcp from 192.168.1.0/24{1-199} to me 143 keep-state :default
03300 allow tcp from 192.168.1.0/24{1-199} to me 443 keep-state :default
03400 allow udp from 192.168.1.0/24{1-199} to me 81 keep-state :default
03500 allow udp from 192.168.1.0/24{1-199} to me 137 keep-state :default
03600 allow udp from 192.168.1.0/24{1-199} to me 138 keep-state :default
03700 allow udp from 192.168.1.0/24{1-199} to me 139 keep-state :default
03800 allow udp from 192.168.1.0/24{1-199} to me 445 keep-state :default
03900 allow udp from 192.168.1.0/24{1-199} to 192.168.1.255 81,137,138,445 in
65000 count ip from any to any
65100 deny ip from any to 255.255.255.255
65200 deny ip from any to 224.0.0.0/24 in
65300 deny udp from any to any 520 in
65400 deny tcp from any 80,443 to any 1024-65535 in
65500 deny log logamount 500 ip from any to any
65535 deny ip from any to any