netstat
Netstat prints information about the Linux networking subsystem. Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
From man page
netstat --help
Here are some useful flags, such as -t
we get the active internet connections that use the TCP protocol.
netstat -t
or the UDP protocol.
netstat -u
You can also see all the process with ports that are currently listening. Who is making contact with my server?
netstat -l
As an example, we can see what are the processes (p
) that have open ports (l
) with the IPv4 protocol (t4
).
netstat -tl4p