Take the 2-minute tour ×

I want to log all network traffic on a Mac OS X server (like tcpdump does), but including the ID of the process that is responsible. Using lsof only gives me the current connections, not the past ones.

Is there a way to do this?

Regards, Jochen

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Sadly, the best way to do this (tcpsnoop, which uses DTrace to do exactly what you describe) does not work on the Mac OS X implementation of dtrace. You'd need some kind of application firewall (Little Snitch for example) but that's more of a desktop / single user thing than something you want running on your server.

This seems like an odd requirement actually, are you trying to make an intrusion detection system, or just figure out what is causing network access?

share|improve this answer
Just trying to see what's causing weird network traffic on my box. Regards, Jochen –  Jochen Feb 22 '11 at 18:17

Your Answer


