0

I have an application running on Windows.
The application listens on port 54000.
I can connect to the application from the local machine and it works fine:

telnet 127.0.0.1 54000

Now, I am trying to connect to this application from remote. I started by adding Inbound Rules for the application, then for the port, finally I disabled Firewall for a private network (I made sure my network is set to private) because none of the above worked.

When I try to connect with telnet from remote I get:

telnet 192.168.1.227 54000
Connecting To 192.168.1.227...Could not open connection to the host, on port 54000: Connect failed

When I try to ping it, the ping succeeds.

On the local machine I check if the port is open, to be sure:

PS C:\Windows\system32> Get-Process -Id (Get-NetTCPConnection -LocalPort 54000).OwningProcess

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
-------  ------    -----      -----     ------     --  -- -----------
    921      52   125336     120816       7.47   7008   1 myApp

I downloaded Wireshark on the local machine to see what is going on.

9345    141.851696  192.168.1.93    192.168.1.227   TCP 62  65153 → 54000 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1
9346    141.851793  192.168.1.227   192.168.1.93    TCP 54  54000 → 65153 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0

As you can see the response is TCP RST which means that the application or the system does not want to talk.
I wonder who sends TCP RST the system or the application?
Can it be that the problem is with the application itself? For example, it can answer to localhost but not others?
Any ideas on how I can investigate this issue more?

  • 1
    What address does the application bind to -- that is, what entries show up in netstat -a -n? – user1686 Apr 22 at 16:35
  • TCP 127.0.0.1:54000 0.0.0.0:0 LISTENING – Chris Apr 22 at 19:18
  • Solved. You were right, the application listened on localhost only. The app required a switch to listen on all interfaces. – Chris Apr 23 at 10:56
0

If you can connect to the application from localhost but not from the remote then make sure to:
1. Add an inbounding rule in Firewall that allows the connection to the selected port or application.
2. Make sure the application listens on the right interface.
This can be checked by running in cmd:

netstat -a -n

Options:
-a Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.
-n Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.

Search for the port that application is supposed to use and check the Local Address:

Proto       Local Address           Foreign Address         State
...
TCP        127.0.0.1:54000           0.0.0.0:0            LISTENING
...

Local Address is the interface which the application listens to. If it is set to 127.0.0.1 it will accept connections from localhost only.
Find a way, in the application, to change it to listen to any interface (0.0.0.0) or the selected one.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.