Monitor network traffic from console

Hi All,

how can I make ifconfig to show me the network traffic from console? Or how can I check the network traffic without installing additional package like wireshark?
 
What does "monitor" mean? For me it is to determine the speeds from host A to Host B.

netstat 1

I like very much "iftop'. It can be installed from ports.


For dumping/sniffing/inspecting the packet contents (what wireshark does) you can use "tcpdump" like SirDice suggested or install "ngrep" from ports.
 
Last edited:
is there a way to display the application that is generating the traffic?

Sorta, but not really. And not in a super-duper easy-peasy way. :D

You can look at things like net-mgmt/iftop or net/trafshow to see the traffic in action, along with the ports being used to send/receive the traffic.

Then compare that to the output of things like procstat(1), netstat(1), sockstat(1) and the like to get the name of the process that's sending the traffic. However, that only lists what's currently running, so there's a bit of a race between "finding the port being used to send the data" and "finding the process using that port". If it's a long-running connection/transfer, then you might be able to see it. But if the sending/receiving process changes ports (new session/connection), then you won't see the old one in the list.
 
Back
Top