Monitor Network with netstat command in Linux

Windows Articles

How to install Django on Ubuntu 20.04?

Developing web applications is usually related to PHP frameworks. However, Python, which is a very versatile programming language, also has a framework...

How to install the Development and build tools on Ubuntu 20.04?

In this very short post, you will learn how to install a series of development and build tools on Ubuntu 20.04. These...

How to set a drive as read-only in Windows 10

Hello! Hard drives are a fundamental element in any operating system. Of course, Windows 10 is no exception. In fact, this is...

How to create a new KVM virtual Machine on Debian 10?

In the previous post, we explained how to install KVM on Debian 10. Now it's time to create a KVM Virtual Machine.

How to repair a USB drive in Windows 10.

Hi! USB sticks are undoubtedly very functional elements for working in Windows 10. Indeed, their use ranges from file management to creating...
Muhammad Nabeel
Muhammad Nabeel
Network and System Administrator

netstat (network statistics) is a command-line network tool that displays network connections for Transmission Control Protocol (both incoming and outgoing). It is also monitor routing tables, number of network interface and protocol statistics. netstat is available on Linux operating systems.

We can use it for finding problems in the network and to determine the amount of traffic on the network as a performance measurement. It is very useful tool for monitoring and diagnosing connection problems.

Intsall netstat

In case, you are unable to use netstat command, use below command to install it.

yum install -y net-tools

Now it is installed and ready to use.
Below are some useful commands to monitor network connections.

Display network interfaces

You can run below command to see all available network interfaces on the server.

netstat -i

Print all TCP and UDP listening Ports

Now, if you want to see all listening ports on the server, use below command.

netstat -a | more

List only TCP Ports connections

so, issue following command to see all TCP connections.

netstat -at

Show only UDP Ports connections

Then, run following command to see all UDP connections.

netstat -au

List services names with PID

Then, see all services with their process ID’s

netstat -pt

Display kernel routing information

Use below command so you can see kernel routing information.

netstat -r

Print Netstat Information Continuously

netstat -c

Finding Listening service

Note: Replace ssh with your service name.

netstat -ap | grep ssh

That’s it, to get more information and options about netstat command read manual for netstat command using “man netstat” command

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to install Django on Ubuntu 20.04?

Developing web applications is usually related to PHP frameworks. However, Python, which is a very versatile programming language, also has a framework...

How to install the Development and build tools on Ubuntu 20.04?

In this very short post, you will learn how to install a series of development and build tools on Ubuntu 20.04. These...

How to set a drive as read-only in Windows 10

Hello! Hard drives are a fundamental element in any operating system. Of course, Windows 10 is no exception. In fact, this is...

How to create a new KVM virtual Machine on Debian 10?

In the previous post, we explained how to install KVM on Debian 10. Now it's time to create a KVM Virtual Machine.

How to repair a USB drive in Windows 10.

Hi! USB sticks are undoubtedly very functional elements for working in Windows 10. Indeed, their use ranges from file management to creating...