Skip to main content

TCP Connection Testing with Telnet

Posted on March 1, 2019 by MichaelChristianMichaelChristian

The beauty of Telnet is that it’s available for almost any operating system, and it’s installed by default on many. While the use of insecure Telnet for network communication eventually gave way to encrypted protocols, like SSH, its usefulness lives on. Telnet is the perfect tool for testing TCP port connectivity. Let’s walk through how to use Telnet for TCP connection testing, as taught in Linux Networking and Troubleshooting.

Using Telnet

Perhaps you’ve just finished building an environment in AWS, and you’re getting ready to migrate some on-premises web content to something more scalable. You’ve configured your VPC, added the security groups, and instantiated the EC2 instances. How can you verify your ingress rules are set appropriately for the workload you plan to move to the EC2 instances?

For services listening on TCP ports, it’s simple – just use Telnet! Here’s an example.

Check HTTP Connectivity

Let’s say you want to check HTTP connectivity to, you’d use:

telnet 80

And what you’d be looking for is this:

Connected to
Escape character is '^]'

This tells you when the connection was able to be made successfully. At this point, you’ll usually hit CTRL+C and type “quit” to exit Telnet, but you could also use Telnet to request some data.

Pull HTTP Headers

Let’s say you want to pull the HTTP headers of, instead of quitting, you’d type:


Telnet HTTP header request

Followed by ENTER twice:

Header pulled from

Not only will you be able to verify that port 80 was open and permitting communication, but you’ll also be able to perform some validation against the service itself. The use case can be extended to pull the web page’s HTML as well using something like:

GET /index.html HTTP/1.1

This, of course, assumes index.html exists at the root level of the site, and that 1.1 is the right HTTP host header specification.

These are just a few examples of what Telnet can help with. For even more flexibility, including the ability to listen on TCP and UDP ports, you should check out netcat!  Get a deeper dive of all this and more in the latest hands-on training course: Linux Networking and Troubleshooting.

Related Resources:


Leave a Reply

Your email address will not be published. Required fields are marked *