Reply
Posts: 10
Registered: ‎05-01-2008

Port Forwarding between 2 routers (2 subnets)

Thanks to help in my other thread I was able to get 2 routers to talk to each other on 2 subnets (1.1 and 2.1).
 
Now my next question is how do I forward ports from the internet to subnet 2.1 which is router B?
 
My setup is like this
 
Internet >> Router A (192.168.1.1) >> Router B (192.168.2.1)
 
My device is on router B and I need to forward a port from the internet to router B. Router B is setup in router mode with NAT turned off.
 
I tried to duplicate the port forwarding in each router but I still can't connect.
 
thanks.
 
 
Expert
Expert
Posts: 12,649
Registered: ‎07-16-2006

Re: Port Forwarding between 2 routers (2 subnets)

Do the computer connected to the second subnet 192.168.2.* have normal internet access? If not, port forwarding won't be possible.

In principal, there is only a single NAT gateway on which you would have to configure the port forwarding. However, that's not supported by these routers. 192.168.1.1 will only forward to IP addresses inside 192.168.1.*.

Thus, you can try to setup two chained forwardings, i.e. first setup port forwarding on the first router to the WAN IP address of the second router. For example, to 192.168.1.2 if that's the WAN IP address of the second router.

Then forward the same port on the second router to the IP address of the computer inside the second LAN.

This chained setup will work fine if you would run the second router in gateway mode. However, I cannot tell you whether port forwarding works in router mode. Port forwarding technically is linked to NAT. I think, turning off NAT and putting the router into router mode will disable forwardings. You can test this by trying to connect to the server from a computer in 192.168.1.* using the WAN IP address of the second router, e.g. 192.168.1.2 (and not directly with an IP address 192.168.2.*). If it works in router mode, the chained forwarding should work. If it does not work, there is nothing you can do with the routers you have and the current configuration.
Posts: 10
Registered: ‎05-01-2008

Re: Port Forwarding between 2 routers (2 subnets)

thanks "gv" The computers on the 2.1 sub do have normal internet access. After following your guideline setup I had no problem getting everything working. I had tried the double port forwarding with no luck in router mode, so I guess I am out of luck. If I switch it back to gateway mode, will the static routes still work or would I lose some functionality in either mode (router/gateway). Much appreciated.
Expert
Expert
Posts: 12,649
Registered: ‎07-16-2006

Re: Port Forwarding between 2 routers (2 subnets)

In gateway mode you are not able to access 192.168.2.* from 192.168.1.*. You won't need any static routes in gateway mode.

For testing there should be no need to remove the static route. If you have both forwardings set up correctly, simply switch to gateway mode and see if it makes a difference. Again, it is sufficient to test whether you can access the server in 192.168.2.* on the WAN IP address of the second router (e.g. 192.168.1.2) from inside 192.168.1.1. You don't really have to test this from the internet.

Also remember: it is not possible to test port forwardings from inside. You cannot test a port forwarding on the first router by accessing your public IP address from inside the LAN. The router will internally rewrite the IP address and consider it a access on 192.168.1.1 and thus will not run through NAT nor will forward anything.
Highlighted
Posts: 10
Registered: ‎05-01-2008

Re: Port Forwarding between 2 routers (2 subnets)

gv: I did test access to the server from the 192.168.1.1 side and it worked fine. I had my laptop plugged in and I was able to log into the server.
 
I had an off site computer I accessed via VNC, and tried hitting the WAN address of the 192.168.1.1 side but I wasnt able to log in and got the error message, so it seems the port forwarding stopped while inside the 192.168.1.1 sub.
 
This was while in ROUTER mode.
Expert
Expert
Posts: 12,649
Registered: ‎07-16-2006

Re: Port Forwarding between 2 routers (2 subnets)

If you can access the server from the 192.168.1.* LAN through the WAN IP address of the second router (i.e. also inside 192.168.1.*) and the forwarding configured then the chained forwards should also work. You have to check the settings. Maybe you want to post the exact settings you have at the moment on both routers.