Hi there, hoping to find some help with a naive networking question.
I recently bought my first firewall appliance, installed Opnsense and am going to use it with my ISP modem in bridge mode, but while I'm learning I added it to my existing LAN with a 192.168.0.0/24 address assigned to the WAN port by my current DHCP. On the firewall's LAN port I set up a 10.0.0.0/24 network and am starting to build up my services. So far so good, but there's one thing I can't get to work: I can't port forward the firewall's WAN IP to a service on the firewall's LAN network and I can't figure out why.
To illustrate, I would like laptop with IP 192.168.0.161 to be able to reach service on 10.0.0.22:8888 by requesting firewall WAN IP 192.168.0.136:8888.
Private IPs and bogons are permitted on the WAN interface and I have followed every guide I can find for the port forwarding, but the closest I have come to this working is a "connection reset" browser error.
Hope my question is clear and isn't very dumb.
Thanks for the help or any explanation why I might be struggling to get this to work. Am I missing something obvious?
UPDATE
The thread is all over the place, but I have made some progress:
RDR rule gets triggered when requesting 192.168.0.136:8888 from 192.168.0.123
a tcpdump (in spoiler below) on the apache container looks inconspicuous to my untrained eye, with the exception of checksum errors in some packets from the docker container (172.20.0.2). The last five lines, after the second GET request (why is there a second GET request?) appear in tcpdump after a delay of about five seconds.
UPDATE 2
I see the exact same behaviour with a second VM and apache directly installed on it instead of in a docker container.
UPDATE 3
Thank you everybody for coming up with ideas. And thank you most of all to @maxwellfire@lemmy.world: The culprit was the Filter rule association in my Port Forward settings which I had as Add associated filter rule but needs to be Pass. As soon as that is set, everything works.
The full solution is a NAT Port forwarding rule with filter rule "pass", an outbound NAT rule for hairpinning, and everything related to reflection turned off in Settings > Advanced. It's that easy! 😵💫
Again, I'm not a network expert. i just wondered if to the firewall your WAN side connection (not Actually WAN) had some baked in rules to drop 192.168 from that side??
If that is not it does your port forward specify IP range to forward from?
Also, would your firewall need dns pointing to 192.168.0.1 upstream? rather than to 8.8.8.8. In case it needs to find addresses on your upstream network when talking back? I'm throwing stuff at the wall here
Pointing DNS to 192.168.0.1 doesn't change anything, and I'm anyway able to talk out from behind the firewall to the 192.168 net, so that would mean that address resolution works in that direction, no?
I do agree, though, that it seems like the responses are not making their way back correctly, as I can see the requests coming in and replied to in the apache logs.