Test Connectivity with Telnet

Telnet is a Network protocol that allows users to connect to and administer a devices Command Line Interface (CLI). However all of the information exchanged on a Telnet session is unencrypted, this means is someone is sniffing the traffic from your host to the device it can be read clearly. So now all know telnet is a super un-secure way to access the CLI of a device, and you should always use SSH where you can, but Telnet can be used in another way. Telnet can only be used to verify network connectivity to remote devices that are TCP based, because TCP is a connection-oriented protocol.

I get requests all the time to open up specific ports on the firewall. You can find a list of the well know port numbers here.

Before I start poking holes in the firewall or other device I check to see if it is already open.

Telnet will by default only check and listen on TCP port 23

If a user asks me is https (port 443) is open to and on a specific server you can easily test with Telnet.

You simply add the port number at the end of the telnet command:

 telnet[host/address[port]]

 

As you can see 443 is open. To exit from the Telnet session: 

SHIFT ]

 

This telnet test to port 23 is not open as it does not say Connected to…


If a remote host does not respond to telnet it can mean a number of things.

  1. The Firewall or Firewalls or other networking devices on the path to the remote host is Denying or Dropping the packets. You will be able to confirm that in the logs on the firewall.
  2. The server or remote host on the other side is not up and active
  3. There is no connectivity to the remote host for some other reason

Further troubleshooting is required if you encounter issues.

Common Port Numbers

Common TCP/IP Protocols and Ports

Protocol TCP/UDP Port Number
File Transfer Protocol (FTP)

(RFC 959)

TCP 20/21
Secure Shell (SSH)

(RFC 4250-4256)

TCP 22
Telnet

(RFC 854)

TCP 23
Simple Mail Transfer Protocol (SMTP)

(RFC 5321)

TCP 25
Domain Name System (DNS)

(RFC 1034-1035)

TCP/UDP 53
Dynamic Host Configuration Protocol (DHCP)

(RFC 2131)

UDP 67/68
Trivial File Transfer Protocol (TFTP)

(RFC 1350)

UDP 69
Hypertext Transfer Protocol (HTTP)

(RFC 2616)

TCP 80
Post Office Protocol (POP) version 3

(RFC 1939)

TCP 110
Network Time Protocol (NTP)

(RFC 5905)

UDP 123
NetBIOS

(RFC 1001-1002)

TCP/UDP 137/138/139
Internet Message Access Protocol (IMAP)

(RFC 3501)

TCP 143
Simple Network Management Protocol (SNMP)

(RFC 1901-1908, 3411-3418)

TCP/UDP 161/162
Border Gateway Protocol (BGP)

(RFC 4271)

TCP 179
Lightweight Directory Access Protocol (LDAP)

(RFC 4510)

TCP/UDP 389
Hypertext Transfer Protocol over SSL/TLS (HTTPS)

(RFC 2818)

TCP 443
Lightweight Directory Access Protocol over TLS/SSL (LDAPS)

(RFC 4513)

TCP/UDP 636
FTP over TLS/SSL

(RFC 4217)

TCP 989/990
The complete list of assigned ports and their assigned services can be seen at http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml.