Linux telnet Troubleshooting
The following sections illustrate the use of telnet TRoubleshooting from a Linux box.
|
Always remember that many Linux servers have the iptables firewall package installed by default. This is often the cause of many connectivity problems and the firewall rules should be correctly updated. In some cases where the network is already protected by a firewall, iptables may be safely turned off. You can use the /etc/init.d/iptables status command on the target server to determine whether iptables is running.
|
Successful Connection
With Linux, a successful telnet connection is always greeted by a Connected to message like this one when trying to test connectivity to server 192.168.1.102 on the SSH port (TCP 22):
[root@bigboy tmp]# telnet 192.168.1.102 22
Trying 192.168.1.102...
Connected to 192.168.1.102.
Escape character is '^]'.
SSH-1.99-OpenSSH_3.4p1
^]
telnet> quit
Connection closed.
[root@ bigboy tmp]#
To break out of the connection you have to press the Ctrl and ] keys simultaneously, not the usual Ctrl-C.
|
In many cases you can successfully connect on the remote server on the desired TCP port, yet the application doesn't appear to work. This is usually caused by there being correct network connectivity but a poorly configured application.
|
Connection Refused Messages
You will get a Connection refused message for one of the following reasons:
Here is some sample output:
[root@bigboy tmp]# telnet 192.168.1.100 22
Trying 192.168.1.100...
telnet: connect to address 192.168.1.100: Connection refused
[root@bigboy tmp]#
telnet Timeout or Hanging
The telnet command will abort the attempted connection after waiting a predetermined time for a response. This is called a timeout. In some cases, telnet won't abort, but will just wait indefinitely. This is also known as hanging. These symptoms can be caused by one of the following reasons:
The remote server doesn't exist on the destination network. It could be turned off. A firewall could be blocking and not rejecting the connection attempt, causing it to time out instead of being quickly refused.
[root@bigboy tmp]# telnet 216.10.100.12 22
Trying 216.10.100.12...
telnet: connect to address 216.10.100.12: Connection timed out
[root@bigboy tmp]#
 |