7

I'm not a networking guy, so I apologize if my question is dumb.

I have two Ubuntu machines setup on Amazon EC2. I need to "talk" from one to the other via port 9300. On my receiving machine, I ran the following from the command-line.

netstat -ntlup | grep 9300

On my client machine, I ran the following from the command-line.

telnet [otherIPAddress] 9300

After entering that command on my client machine, I see the following printed:

Trying [otherIPAddress]...
Connected to [otherIPAddress].
Escape character is '^]'.

Then, I entered 'Hello World' at the command line. Immediately after pressing 'Enter', I see the following:

Connection closed by foreign host.

Why would I get this error? I really need to be able to get this connection running. For the life of me, I can't figure out why I can't communicate over it.

1
  • 5
    The fact that you got Connected to [otherIPAddress] means your connection is working. The connection is getting closed because the remote application/service is closing it, most likely from bad input. You should be good to go to begin real conversations on that port. Unless, of course, the remote app/service is really expecting input of "Hello World".
    – squillman
    Apr 3, 2014 at 18:23

1 Answer 1

11

This appears to be working as expected however, whatever is running on [otherIPAddress]:9300 is not expecting Hello World\n so it dropped the connection.

3
  • On the machine at [otherIPAddress], I run and get the following: telnet localhost Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused
    – user312840
    Apr 3, 2014 at 18:27
  • 3
    @user312840: That's becuase whatever is listening on [otherIPAddress]:9300 is not listening on 127.0.0.1:9300 (connection refused generally means nothing is listening on the IP:port combination).
    – user9517
    Apr 3, 2014 at 18:28
  • 1
    Just because a daemon/service is listening on one interface and port combination does not mean it will respond to localhost connections, or even connections from other interfaces on the same host. Iptables, network settings, or service configurations are all parts of the equation.
    – 0xSheepdog
    Apr 3, 2014 at 18:48

You must log in to answer this question.

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