I have a ubuntu 14.10, and am trying to telnet into it via port 5060 but I keep failing. I always get the message "Connection closed by foreign host".
I checked my iptable, it is default policy to ACCEPT, and ufw is inactive.
So I should be able to telnet into 5060 right? What else could be blocking it?
root@server:/var/log# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
root@server:/var/log#
root@server:/var/log# ufw status
Status: inactive
root@server:/var/log#
but telneting just gives me this.
user@host ~
$ telnet 192.168.0.5 5060
Trying 192.168.0.5...
Connected to 192.168.0.5.
Escape character is '^]'.
Connection closed by foreign host.
I want to run sip traffic on that port later but I can't even open the port right now.
Thanks guys
The output you provided actually means that port
5060
is open and nothing is blocking it, because you gotConnected to 192.168.0.5
. But the connection got terminated by the destination host as soon as it was created, that's why it directly goes toConnection closed by foreign host
. This is probably because the program that is listening on that port is expecting some data as soon as a connection was created, or maybe the program needs to be configured in a different way.If a port is being blocked (or is not open), you will never see
Conneted to <IPaddress>
, but you'd see something like this:You did the right thing by checking
iptables
, but since there are no rules blocking the traffic, you can further verify that the server in fact has port5060
open by executing the following command:You should see an output like this: