Port forwarding (portmap) works only locally

Posted by Tag Wint on Server Fault See other posts from Server Fault or by Tag Wint
Published on 2010-09-04T18:51:28Z Indexed on 2010/12/22 2:55 UTC
Read the original article Hit count: 164

There are four hosts

hostA winXP

hostB Win2003

hostC Linux RHEL

hostD Linux RHEL

hostA cannot connect to C and D directly, but B can

hostA connects to hostB using VPN

hostB and hostC belong to the same subnet1

hostD is in subnet2

From hostA I need to connect to hostC and hostD by SSH.

Now I can do it as follows:

1.connecting from hostA to hostB by RDP logon and there:

2.start putty client.

I'd like to omit step 1 and connect from A to C and D directly

On hostB I have admin acoount and configure port forwarding as follows:

netsh interface portproxy add v4tov4 listenport=N1 connectaddress=hostC_IP connectport=N2

netsh interface portproxy add v4tov4 listenport=N3 connectaddress=hostD_IP connectport=N2

netsh interface portproxy show all:

Listen on IPv4:             Connect to IPv4:
Address         Port        Address         Port
--------------- ----------  --------------- ----------
 *               N1          hostC_IP        N2
 *               N3          hostD_IP        N2

Now from hostB I can connect to either C and D:

ssh localhost:N1

ssh localhost:N3

from hostA ssh hostB:N1 works too, but ssh hostB:N3 DON'T

I guess the reason might be different subnets, still have no idea how to fix it. What should I do?

© Server Fault or respective owner

Related posts about windows-server-2003

Related posts about networking