I need to have access via SSH on an OpenWrt (18.06.4) device, that is behind another router (FritzBox running FritzOS) from outside the local network.
The other router (which connects to the internet) is connected to the WAN port of the OpenWrt router and port-forwaring is set for the port to be forwarded from the other router to the OpenWrt router.
In the OpenWrt router I've added this rule to the firewall setup:
config rule
option target 'ACCEPT'
option proto 'tcp'
option dest_port '2222'
option name 'Open SSH'
option src 'wan'
where 2222 is the port SSH is configured to.
From within the local network I can connect without any problems, however from outside (I've tried via a hotspot on a mobile device) I cannot connect.
Then start a tcpdump in OpenWrt to verify that there is incoming traffic. tcpdump -i INTERFACE -vvn tcp port 2222
where INTERFACE you'll use the physical wan interface, e.g eth1.2
Thanks for the help. I found the solution. The problem was that the device I had for testing only had ipv4 while the router is connected using DS-Lite. When I test it the from an ipv6 device everything works perfect.