How to monitor network traffic on a Linux or Unix like OS
Talk0
1,788pages on
this wiki
this wiki
Sometimes it is necessary or useful to monitor network traffic on your computer. You can monitor all the connections going in and out of your computer.
Contents |
Console based
Edit
These programs run in terminal such as xterm
Logging type
Edit
Using netstat you can monitor every connection going in and out of your computer. This monitors all major protocols including tcp and udp, and every port. netstat is a standard Unix program, so it is likely installed.
netstat also displays unix connections are fairly useless. To display only tcp and udp connection.
- Execute: netstat -t -u
- For displaying continuously
- Execute: netstat -t -u -c
- Output
tcp 0 0 10.0.0.9:57053 71-95-19-141.stat:16359 ESTABLISHED tcp 0 19109 10.0.0.9:49249 5ac33076.bb.sky.c:52782 ESTABLISHED tcp 0 0 10.0.0.9:53874 catv54039CF5.pool:16628 ESTABLISHED tcp 0 0 10.0.0.9:37182 host86-140-193-28.:6881 ESTABLISHED tcp 0 0 10.0.0.9:45563 61-224-49-29.dyna:48227 ESTABLISHED tcp 0 0 10.0.0.9:47665 74.213.68.212:43837 ESTABLISHED
For more details see: man netstat and Introduction to Netstat Tutorial
Visual representations
Edit
Top like
Edit
These programs that operates like top (Unix)
- nethogs
- shows a list of the top processes which use network bandwidth.
- http://nethogs.sourceforge.net/
- jnettop:
- shows a list of the top connections
- http://jnettop.kubs.info/wiki/
- iftop:
- shows a list of the top connections, with bandwidth bars
- http://www.ex-parrot.com/~pdw/iftop/
Graphical
Edit
- Ntop
- http://www.ntop.org/ntop.html
- Gentoo install: emerge ntop
- Netactview