In the OpenWrt 23.05.5 X86_64 version, there is no problem with the port - forwarding of the firewall if it is forwarded to the router itself. However, if it is forwarded to other hosts in the LAN, it doesn't work properly.
I used tcpdump to capture packets and found that the forwarding did occur, but the source IP address was not masked. At this time, the forwarded host would respond through its own gateway (not the router gateway). Therefore, it doesn't work properly. I forcibly changed the LAN to masked and then the forwarding worked normally. I also found another router to try and found that the router that worked normally would mask the source address as no - data. Could you tell me how to fix this problem, please?
This is forcibly mask packet " OpenWrt.lan.50812 > 192.168.18.2.80"
This is normal mask packets "no-data.63841 > 192.168.18.2.80"
let's take a look at the config to see if there are any clues. Please make sure you've got the desired port forward in the config.
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
ubus call system board
cat /etc/config/network
cat /etc/config/firewall
This option is off by default. In the off state, the source IP will not be masquerad and will be like 185.199.111.133.50812 > 192.168.18.2.22 when forwarding. But there is another gateway on my machine 192.168.18.2, it will respond through its own gateway after receiving the data packets instead of returning the data packets to 192.168.18.1.
This option is off by default. In the off state, the source IP will not be masquerad and will be like 185.199.111.133.50812 > 192.168.18.2.22 when forwarding. But there is another gateway on my machine 192.168.18.2, it will respond through its own gateway after receiving the data packets instead of returning the data packets to 192.168.18.1.
What other gateway is in the network? Although you mentioned it, I'm not sure exactly how this relates to the overall network architecture and the problem at hand. Could you draw a system topology diagram for us (the more comprehensive, the better).
Thanks for the diagram. I'm still quite confused... this is a very unusual topology.
I see that you're trying to ssh in from the client to the wan of the x86 (right hand router) and it seems that your port forward target is another router (192.168.18.2)??
What's confusing, though, is the relationship with the other router (192.168.18.2)... Why is it there? If this is a dual wan setup, why not put both wans on the same router and use mwan3 and/or policy based routing to handle the two connections?