From the course: Linux: Network Configuration
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Monitor network port activity - Linux Tutorial
From the course: Linux: Network Configuration
Monitor network port activity
- [Instructor] When we use IP networking, services communicate using sockets. A socket is the combination of an address and a port, and there can only be one socket per combination of port and address. So for example, if our SSH service is listening on 10.0.1.101 TCP port 22, nothing else on that system can use that socket, that specific combination of address port and protocol. Because sockets are so important to communication, it's useful to know how to see what sockets exist on a given system. The legacy net tools package gives us the program netstat for this purpose. And the more modern IP route toolset gives us the program ss. Both programs work in a similar way and we'll often use whichever program is at our disposal to explore which sockets are actively connected, which are listening and what process or program is responsible for a given socket. Across both programs, the option -t shows active TCP sockets,…