Solved FreeBSD's netstat usage

S

Sensucht94

Guest
Hi, I'm asking a very stupid question here, but i didn't mange to find a solution myself, so please bare with me

how to list all opened/forwarded ports, with associated running daemon and PID, potentially established connection and relative IPs?

I mean, the equivalent of a nestat -ant in GNU's net-tools port applied to FreeBSD's netstat(1)

Thank you
 
Look into sockstat(1). Basically everything which you might want to monitor has a "stat" application (that's how I like to call this). So: sockstat, vmstat, lockstat, procstat, nfsstat, modstat, etc.
 
I believe -a and -n work the same way. Replace -t with -p tcp (for protocol == TCP/IP) or maybe -4.

awesome, thanks, I had missed the -p switch in man page. Meanwhile I've also discovered sockstat(1): a sockstat -l4 practically does exactly what I was looking for ;)
 
Back
Top