Hello.
I've been using FreeBSD and PF for a while now and it's really nice
I have one problem though.. I have a FreeBSD as a gateway with NAT and firewall and then in my local LAN I have more computers behind. The computers are running various type of services.
So now I have a NAS behind my FW which I want to be able to reach via SSH from outside, so I have set this rule:
The NAS have IP 172.16.8.12 ofc and ssh are running on port 2222. Port 22 is taken from the outside world by the FreeBSD gateway itself, hence the other port.
It is possible to ssh to the NAS from the gateway but not from the outside, then I get "Connection refused". I have also tried to remove the "pass" keyword and add
a separate pass in rule to just open the port.
I have also the sysctl inet forwarding flag set to 1.
Any suggestions why this won't work?
I have other services running behind NAT but for that I use nginx as a reverse proxy but it seems overkill to do that in this case when I just want to expose ssh from the NAS.
I've been using FreeBSD and PF for a while now and it's really nice

I have one problem though.. I have a FreeBSD as a gateway with NAT and firewall and then in my local LAN I have more computers behind. The computers are running various type of services.
So now I have a NAS behind my FW which I want to be able to reach via SSH from outside, so I have set this rule:
Code:
rdr pass on $ext_if proto tcp from any to any port 2222 -> 172.16.8.12
The NAS have IP 172.16.8.12 ofc and ssh are running on port 2222. Port 22 is taken from the outside world by the FreeBSD gateway itself, hence the other port.
It is possible to ssh to the NAS from the gateway but not from the outside, then I get "Connection refused". I have also tried to remove the "pass" keyword and add
a separate pass in rule to just open the port.
I have also the sysctl inet forwarding flag set to 1.
Any suggestions why this won't work?
I have other services running behind NAT but for that I use nginx as a reverse proxy but it seems overkill to do that in this case when I just want to expose ssh from the NAS.