Netstat Real-time TCP/IP Monitoring

3

2

Using Mac OS X's Terminal application, I want to use netstat to display a real-time, continuous listing of my internet connections.

For example, with Terminal open and the proper netstat command in use, each time I browse to a website, display the source and destination IP addresses and ports.

netstat -w 3 displays real-time packet and byte info. I figured netstat -w 3 -p tcp would show actual source and destination addresses, but it does not.

Any suggestions? Thank you!

firewater

Posted 2012-05-30T19:53:52.170

Reputation: 31

Answers

3

Sounds like you either want "tcpdump -p tcp" or "watch 'netstat -p tcp'" depending on which output you're interested in.

mikebabcock

Posted 2012-05-30T19:53:52.170

Reputation: 1 019

1Can you elaborate a bit on tcpdump -p tcp? Cheers. – voices – 2015-09-25T01:33:13.170

Oh, & watch too.. – voices – 2015-09-25T01:34:50.677

tcpdump -p tcp simply shows you all the tcp packets going through your default network interface, and watch runs a command repeatedly showing you the output as it changes. – mikebabcock – 2015-09-28T02:00:12.593

0

For mac or OSX, try this:

nettop -p 60683

You can also restrict the interface type, like wifi or wired...

nettop -t wifi -n -p 60683

sully

Posted 2012-05-30T19:53:52.170

Reputation: 1