Linux: Network Connection Statistics

Note

The net-tools linux package is an old one, and provides a large number of standard commands:

  • arp
  • ifconfig
  • iptunnel
  • iwconfig
  • nameif
  • netstat

net-tools was deprecated in 2011. While is it still available it is advisable to move on to more modern commands.

Troubleshooting network applications is often aided by reviewing the applications on the system with open ports, waiting for network traffic to connect. To do this in a Linux terminal, run this command:

ss -tulpn
ss -tulpn
ss -tulpn
ss -tulpn

ss options mean:

SwitchMeaning
tshow TCP connections
ushow UDP connections
lshow listening sockets only
pinclude PID for listening processes
nfaster output by skipping resolving IP addresses to hostnames

Install the ss command with:

dnf -y install iproute2
apt -y install iproute2
apk add iproute2
pacman -Syu iproute2