Ludovico
Ludovico

Reputation: 251

Redirect port on Windows from loopback to outside

I have a socket that listen on port 6100 on my development machine, whose lan address is 192.168.1.2

I can access the socket and use it with the address 127.0.0.1:6100, but I can't access it from 192.168.1.2:6100 (I need to access the socket from another client on the Lan)

If I type netstat -an | find "6100" on the command prompt I get:

TCP 127.0.0.1:6100 0.0.0.0:0 LISTENING

So I need to redirect all calls to 192.168.1.2:A_RANDOM_PORT to 127.0.0.1:6100

How can i do that?

I tried with:

netsh interface portproxy add v4tov4 listenport=6200 listenaddress=192.168.1.2 connectport=6100 connectaddress=127.0.0.1

But without luck

Upvotes: 2

Views: 1283

Answers (2)

Ludovico
Ludovico

Reputation: 251

I've finally been able to accomplish this task, but only using an external tool.

I downloaded "PassPort port forwarding utility" and set up a redirection from 192.168.1.2 to 127.0.0.1

Unfortunately I haven't been able to do that without an external tool.

Upvotes: 2

user207421
user207421

Reputation: 310980

You failed to post the code concerned, but you bound your listening socket to 127.0.0.1 instead of 0.0.0.0. Just fix that. No oort forwarding required.

Upvotes: 0

Related Questions