Tutorials  /  Linux Basics

Monitor Network Connections on CentOS Using ss

Ccentron Redaktion · July 2025 ·4 min read ·Linux Basics, Tutorial

The ss utility, part of the iproute2 package, is a powerful tool for reviewing socket statistics. The name stands for "socket statistics" and allows administrators to view detailed information about sockets, including TCP, UDP, and Unix domain sockets.

For system administrators, analyzing these statistics can help diagnose and resolve potential network connectivity problems.

Unlike older tools like netstat, ss operates significantly faster, making it ideal for systems under heavy traffic. Because of this efficiency, ss is often preferred over netstat for real-time network monitoring.

Requirements

  • A CentOS 6.x 64-bit server instance
  • A user with sudo privileges
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Installing ss (if not already available)

Most modern Linux distributions come with ss pre-installed. If it’s missing, you can install it along with its documentation on RPM-based systems using:

Console
sudo yum install iproute iproute-doc

Common Usage Examples of ss

The following examples highlight typical ss commands. For a full list of options, use the help flag:

Code
ss --help

Display a Summary of Socket Usage

Code
ss -s

Show Listening IPv4 Sockets with Process Information

Code
ss -4nlp

This is a combination of the following flags: -4, -n, -l, and -p.

Display IPv4 Sockets Only

Code
ss -4

Show Port Numbers Instead of Service Names

Code
ss -n

List Listening Sockets

Code
ss -l

Display Processes Using Sockets

Code
ss -p

View All Socket Connections

Code
ss -a

Filter by Socket Type

List TCP, UDP, RAW, or Unix domain sockets:

Code
ss -at
ss -au
ss -ar
ss -ax

Find the Process on Port 22

Code
ss -lnp | grep 22

Note: You must use the -n flag together with the port number (e.g., 22) to ensure accurate output.

Show Connections to a Specific Remote Host

Code
ss dst 123.123.123.123

Filter by Local Address and Port

Code
ss src 12.34.56.78:80

View Help Options

Code
ss -h

or

Code
ss --help

Conclusion

The ss command is a versatile and efficient tool for real-time socket analysis on CentOS and other Linux systems. With its rapid performance and flexibility in filtering data, it is highly beneficial for system administrators managing modern, high-traffic servers. Mastering the various ss options can greatly enhance your ability to monitor and troubleshoot network activity effectively.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren