I'd like to know all the connections my system is making to the internet. I tried netstat
but that shows a lot of connections - all of which aren't applicable I think. Can it be displayed like top
does for processes ?
I'm a little security conscious and would like to know all the incoming and outgoing connections happening on my system.
Using
netstat
netstat
by itself monitors all major protocols including TCP and UDP on every port.If you want to display TCP and UDP connections:
If you want to display that continously:
Similar to
top
:nethogs - shows a list of the top processes that use bandwidth
jnettop - shows list of top connections
iftop - shows list of top connections with bandwidth bars
GUI Interface (just in case):
Ntop
Netactview
You may try
ss
as well, it's more advanced thannetstat
.$ ss --tcp -all
List all TCP connections (including those with non-established state, e.g.
SYN-SENT
,LISTEN
, andTIME-WAIT
). Read more about TCP states transition in RFC793.$ ss --tcp --all --processes
Include information about the owner process of the connections (e.g., process name and PID)
$ ss state established '( dport = :ssh or sport = :ssh )'
Display all established SSH connections.
$ ss --options state fin-wait-1 '( sport = :https )' dst 193.233.7/24
List all the TCP sockets in state
FIN-WAIT-1
for network 193.233.7/24 and look at their timers with--options
, which shows timer information.