Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 2001 16:44:27 -0600
From:      Jason Hunt <jason.hunt@niicommunications.com>
To:        freebsd-questions@freebsd.org
Subject:   netstat question.
Message-ID:  <3A89B8CA.F3023C25@niicommunications.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A89B8CA.F3023C25>