One of the common tasks for sysadmin is to check the connectivity to troubleshoot networking issues. It could be anything like application can’t connect to backend service, unable to fetch data from external URL, verify if the flow is opened, etc. Whatever it might be, the following utility/commands would help you. They are tested on CentOS, and I don’t see any reason not to work on another Linux distro. Let’s explore…

telnet

One of the widely used commands to test essential connectivity between servers, server to another network device’s IP. The syntax for the command is easy. Let’s say you want to test if you can connect to port 8080 on 10.0.0.1 IP address; then the command would be. If there is no issue in connecting, then you should see the connected message. Note: if you get a command not found while executing telnet then you need to install telnet as I explained here. In most of the scenarios, telnet should help. However, if you need some other option then here are some telnet alternatives.

ncat or nc

Ncat (a.k.a. nc) is a powerful network utility with many features like bind and accept a connection, execute commands remotely, write and read data, etc. It works on IPv4 and IPv6, both. To do a simple test to check if the port is opened or not, you will execute the following. Let’s take an example of testing 443 port on geekflare.com. As mentioned, you can also use nc to bind the connection to listen on a particular port. This can be handy when you don’t have actual services running but want to ensure connectivity exists. To start listening on a port: It will bind the port to a given number. If ncat is not installed, then you can get it done with yum install nc on CentOS/RHEL servers.

wget

wget is a useful command to download/test HTTP, HTTPS, and FTP. If you are working as a web engineer or often dealing with web-related issues then wget is your friend. Testing using wget is straightforward. Here is an example of testing tools.geekflare.com If it shows connected means there is no connectivity issue. Check out this to see some of the frequently used wget command examples.

curl

A curl is a multipurpose tool. Do you know you can telnet to a port using curl? Well, now you know. The following is a working example. And, when there is no listening port or firewall issue, then you will see trying… You can also use curl to download the data. It supports multiple protocols – HTTP, HTTPS, FTP, IMAP, LDAP, POP3, SCP, SFTP, GOPHER, etc.

nmap

A popular tool with hundreds of features. Often this is considered as a security tool, nmap lets you test a single IP/port or in the range. To test a single port An example of testing port 443 on siterelic.com Look at the state column. If you see open means connection is ok. And, if the state is filtered that means connectivity doesn’t exist.

Ping

One of the widely used commands is to check if a remote host is responding to ICMP ECHO_REQUEST or not. Keep in mind, this may not give you accurate results when ICMP is blocked at the remote network’s firewall. Assuming that’s not the case, you can ping to IPv4 or IPv4 network endpoint as below. For example, success result of geekflare.com For example, failure result of internal IP. If the endpoint supports IPv6, you can use the ping6 command as below. If you need to do remote ping over the Internet, you can use the online ping tool.

Conclusion

telnet is phasing out in the latest Linux version. Thanks to the above telnet alternative. If you are new to Linux and looking to learn then check out this Udemy course.

6 Linux Utility to Test Network Connectivity - 166 Linux Utility to Test Network Connectivity - 986 Linux Utility to Test Network Connectivity - 326 Linux Utility to Test Network Connectivity - 376 Linux Utility to Test Network Connectivity - 726 Linux Utility to Test Network Connectivity - 136 Linux Utility to Test Network Connectivity - 446 Linux Utility to Test Network Connectivity - 186 Linux Utility to Test Network Connectivity - 746 Linux Utility to Test Network Connectivity - 876 Linux Utility to Test Network Connectivity - 866 Linux Utility to Test Network Connectivity - 956 Linux Utility to Test Network Connectivity - 566 Linux Utility to Test Network Connectivity - 396 Linux Utility to Test Network Connectivity - 316 Linux Utility to Test Network Connectivity - 626 Linux Utility to Test Network Connectivity - 786 Linux Utility to Test Network Connectivity - 646 Linux Utility to Test Network Connectivity - 906 Linux Utility to Test Network Connectivity - 66 Linux Utility to Test Network Connectivity - 866 Linux Utility to Test Network Connectivity - 256 Linux Utility to Test Network Connectivity - 1