0

I've configured a router model TP-WR940 v6 as an internal LAN2 (192.168.0.0) inside my main LAN1 (192.168.1.0). Router is connected to the LAN1 as any other device, and have a fixed IP in that LAN.

I want to access a device connected to LAN2 (using Wifi) from LAN1, so I configured the forwarding in the router configuration. Opened external port 10022 to 22 to use ssh connection. And the same for port 18080-8080, but I'm unable to access such ports from LAN1.

I tested a ping from the LAN2 router and it works (attached image), so I'm pretty sure the device is there. Accessing port 22 from LAN2 is also working, but not from the LAN1 when using forwarding.

enter image description here

The question is: How the router manages the forwarding and NAT?, I have the suspect that the final device (192.168.0.102) see the real origin IP address of TCP and it is restricted by the device firewall.

Does the fact that the device is using wifi in LAN2 some limitation regarding port-forwarding?

Is it possible to change how the router manages the source IP when forwarding?

Is there any possible configuration to grant access from LAN2 without change the device FW configuration?

3
  • 1
    Don't all routers preserve the source IP when doing port-forwarding NAT? Aug 7, 2022 at 20:50
  • Probably you are right. I'm not sure why it doesn't work. Actually doing some testing and configuration, and traying to debug the connection. I think I mixed port-forwarding with inverse-nat, that are two different things... On any case, I will report here the solution when I find whats really stopping port-forwarding to work.
    – gavioto
    Aug 7, 2022 at 22:09
  • @user1686 I finally found the problem. Thanks for your comment that help me to figure out that I should find in other place.
    – gavioto
    Aug 8, 2022 at 0:34

1 Answer 1

0

Finally I figured out that the device (a RaspberryPi using Ubuntu Core) was not routing the packet correctly.

This was the device ip route list output:

default via 192.168.1.1 dev wlan0 proto static 
default via 192.168.0.1 dev wlan0 proto dhcp src 192.168.0.102 metric 600 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.102 
192.168.0.1 dev wlan0 proto dhcp scope link src 192.168.0.102 metric 600 

After removing the first entry the port forwarding worked. I used the command:

ip route del default via 192.168.1.1 dev wlan0 proto static
1
  • what did make you think the first line printed by ip route list was to be removed?
    – Tms91
    Feb 22 at 21:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .