Netstat is derived from the words network and statistics it is a program that is controlled via commands issued in the command line. It delivers basic statistics on all network activities and informs users on which ports and addresses the corresponding connections (TCP, UDP) are running and which ports are open for tasks. In 1983, netstat was first implemented into the Unix derivative BSD (Berkley Software Distribution), whose version 4.2 supported the first internet protocol family, TCP/IP. netstat has been integrated into Linux since its debut in 1991 and has been present in Windows since the appearance of version 3.11 (1993), which could also communicate via TCP/IP with the help of extensions. While the parameters of netstat’s commands (as well as their outputs) differ from system to system, when it comes to their functions, the various implementations are very similar.
Essentially, netstat is a command line program and for this reason doesn’t feature a graphical user interface. Programs like TCP VIEW, which was developed by the Microsoft division Windows Sysinternals, makes it possible for statistics to be displayed graphically.
Netstat Command
With Netstat we can also solve some problems that may arise with our network connection. There are different parameters that we can take into account. We are going to show which are the most used parameters to find specific details of the network.
- Netstat –a : allows us to know all the networks that are active or inactive at any given time. In this way we will be able to detect possible problems that affect a network.
- Netstat –e : in this case we can see statistics about incoming and outgoing network packets on a network card.
- Netstat –f : Displays the fully qualified domain name of remote addresses.
- Netstat –n : This command, unlike the previous one, displays port numbers instead of names.
- Netstat –o : shows the ID of each process on each connection.
- Netstat –p X: with this command we can filter connections according to the protocol (TCP, UDP, tcpv6 or tcpv4. X = TCP, UDP… the protocol we want. For example, it would be netstat –p TCP.
- Netstat –q : Query the linked listening and non-listening ports.
- Netstat –s : Shows group statistics by protocol. Thus we can classify networks according to the available protocols: TCP, UDP, ICMP, IPv4 or IPv6.
- Netstat –r : this command shows us the routing table of the current network.
- Netstat –t : Provides information about the connections in the download state.
- Netstat –x : in this case we can obtain information about all NetworkDirect connections.
In short, these are some commands that we can use with Netstat to obtain information related to our connections. This also allows us to solve some problems.
How to use and troubleshoot network problems with Netstat
In addition to simply obtaining statistical data on network use and having information that may be interesting to users, we will also be able to solve certain network problems that may arise. After all, Netstat shows us an image of different aspects related to the connection.
Use Netstat
To use Netstat in Windows we must go to the command line. For this we go to Start, write CMD and run it in administrator mode. Later we simply have to write netstat and hit Enter.
There it will show us all the active connections on this device. The first column, Proto, shows us the protocol (TCP or UDP). The second column informs us of the IP addresses and ports of the network interfaces of that equipment for each of the connections. We can also see the IP addresses and ports of the remote devices. Another question that we can see thanks to Netstat is if the connection is active or closed. The process of loading all connections may take a few minutes, depending on how many there are. However, it is not something that requires a lot of time. We can see the port numbers of the connections instead of the port names. For this we have to do is run the command netstat -n . We will see that the same information appears as before, but this time the port numbers of the remote connections. Drop your comment below. |