I am using PF on FreeBSD 13.2.
I have installed a VM using bhyve and I'd like to be able to access certain services running inside the VM.
From the host, I am able to access the service ports in a VM (ssh, HTTP, etc).
I am stuck on how to adjust my pf.conf so that I can access SSH/HTTP from the Internet.
I have two rules:
Both of these rules don't work.
My sysctl.conf:
In my /etc/rc.conf:
My full pf.conf can be seen at: https://pastebin.ubuntu.com/p/cWxCdNxFGH/
Thank you in advance for any insights.
I have installed a VM using bhyve and I'd like to be able to access certain services running inside the VM.
From the host, I am able to access the service ports in a VM (ssh, HTTP, etc).
I am stuck on how to adjust my pf.conf so that I can access SSH/HTTP from the Internet.
I have two rules:
Code:
# VM1 HTTP access
rdr pass on $ext_if inet proto tcp from any to any port { 8082, 8999 } \
-> 172.16.0.99 port 80
# VM SSH access
rdr pass on $ext_if inet proto tcp from any to any port 2222 \
-> 172.16.0.99 port 22
Both of these rules don't work.
My sysctl.conf:
Code:
net.inet.ip.forwarding=1
net.link.tap.up_on_open=1
net.link.bridge.pfil_member=0
net.link.bridge.pfil_bridge=0
net.link.bridge.pfil_local_phys=1
In my /etc/rc.conf:
Code:
cloned_interfaces="bridge0 tap0 tap1 tap2 tap3 tap4 tap5"
ifconfig_bridge0_name="vmbridge"
ifconfig_vmbridge="addm em1 addm tap0 addm tap1 addm tap2 addm tap3 addm tap4 addm tap5 up"
ifconfig_vmbridge_alias0="inet 172.16.0.1 netmask 255.255.255.0"
My full pf.conf can be seen at: https://pastebin.ubuntu.com/p/cWxCdNxFGH/
Thank you in advance for any insights.