NetCat

How do I Ping a Specific Port?

How do I Ping a Specific Port?

We shall take “ping a specific port” to mean that you want to verify a specific port's status for a given IP address. This is useful for troubleshooting why a service is not working properly.

This article will show you how to verify a specific network port's status by using Netcat, Nmap, and Nping.

Ping a Specific Port with Netcat

The Netcat tool is used to retrieve information about network connections and listens.

If Netcat is not installed on your Linux machine, run the command below:

Ubuntu/Debian based systems:

$ sudo apt install netcat

CentOS/Red Hat based systems:

$ sudo dnf install nc

Or try

$ sudo dnf install netcat

You may use Netcat to ping a specific port as follows.

nc -vz

Replace <IP> and <Port> as appropriate.

For example:

$ nc -vz 192.168.0.1 22

Figure 1 - Ping a specific port with Netcat

For more options and additional help using Netcat, run the command below.

$ nc -h

Ping a Specific Port with the Nmap tool

The Nmap tool is typically used to scan a network host to obtain information about available ports and services.

If the Nmap tool is not already installed on your Linux machine, run the command below:

Ubuntu/Debian based systems:

$ sudo apt install nmap

CentOS/Red Hat based systems:

$ sudo dnf install nmap

Now, you may use Nmap to ping a specific port. The syntax i.

nmap -p

For example:

$ sudo nmap -p80 192.168.0.1

Figure - Ping a specific port with nmap

For additional options and help using Nmap, run the command below.

$ nmap -h

Ping a Specific Port with Nping

Nping is part of Nmap and works somewhat similar to the standard ping utility. You can use the Nping tool to ping a specific port as follows.

nping -p

For example:

$ nping -p22 192.168.0.1

Figure 2 - Ping a specific port with Nping

For additional options and help using Nping, run the command below.

$ nping -h

Conclusion

This article showed you how to ping a specific port with Netcat, Nmap, and Nping. Do let us know which of these tools works best for you.

How to Change Mouse and Touchpad Settings Using Xinput in Linux
Most Linux distributions ship with “libinput” library by default to handle input events on a system. It can process input events on both Wayland and X...
Remap your mouse buttons differently for different software with X-Mouse Button Control
Maybe you need a tool that could make your mouse's control change with every application that you use. If this is the case, you can try out an applica...
Microsoft Sculpt Touch Wireless Mouse Review
I recently read about the Microsoft Sculpt Touch wireless mouse and decided to buy it. After using it for a while, I decided to share my experience wi...