Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 2001 17:41:31 -0500 (EST)
From:      Dru <genisis@istar.ca>
To:        Jason Hunt <jason.hunt@niicommunications.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: netstat question.
Message-ID:  <Pine.BSF.4.21.0102131740560.28676-100000@x1-6-00-00-b4-94-9d-3f.kico1.on.home.com>
In-Reply-To: <3A89B8CA.F3023C25@niicommunications.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Hi Jason,

Have you tried:

sockstat -4

Cheers,

Dru


On Tue, 13 Feb 2001, Jason Hunt wrote:

> greetings,
> 
> in linux I am to list active connections with their pid, here is
> an example of the output:
> 
> netstat -anp
> 
> Active Internet connections (servers and established)
> Proto Recv-Q Send-Q Local Address           Foreign Address         State
> PID/Program name
> tcp        0     44 63.210.138.9:22         38.196.126.5:62859      ESTABLISHED
> 1793/sshd2
> tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
> 369/sshd2
> tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN
> 9708/vtund[s]: wait
> raw        0      0 0.0.0.0:17              0.0.0.0:*               7
> 5834/portsentry
> raw        0      0 0.0.0.0:6               0.0.0.0:*               7
> 5832/portsentry
> raw        0      0 0.0.0.0:1               0.0.0.0:*               7
> -
> raw        0      0 0.0.0.0:6               0.0.0.0:*               7
> -
> Active UNIX domain sockets (servers and established)
> Proto RefCnt Flags       Type       State         I-Node PID/Program name
> Path
> unix  2      [ ]         DGRAM                    4590   5665/syslogd
> /dev/log
> unix  0      [ ]         STREAM     CONNECTED     52     93/klogd
> @00000001
> unix  0      [ ]         DGRAM                    118672 369/sshd2
> unix  0      [ ]         DGRAM                    72571  9708/vtund[s]: wait
> 
> 
> The great thing about this, was I could grep for a certain pid to find
> out where the connection was coming from (samba connection for
> example).  Is there a way in FreeBSD to accomplish this?  I looked
> in the manpages and couldn't find any reference to PID's.  Thanks
> 
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 
> 
> 
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0102131740560.28676-100000>