mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Fleming <john@spikefishsolutions.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: How to find information about kernel based open ports?
Date: Tue, 25 Apr 2023 15:18:10 +0000	[thread overview]
Message-ID: <DM5PR01MB2812871BCF7C026223782698AC649@DM5PR01MB2812.prod.exchangelabs.com> (raw)

Is there anyway to query to the kernel for open sockets? This is more from an administrative point of view. For example NFSD.ko and VXLAN.ko can create listening sockets (maybe that isn't the correct term). I was going to ask if I can tell which kernel module had a port open, but I guess in theory a module could be built into the kernel so I'm really not sure how to propperly ask the question.

But basically is their a way to query the kernel for open sockets in the case of a socket being opening by the kernel and not say a process.

Here is the best I can find using netstat. I see the PID/Program name is "-" which tells me it's the kernel (I think), but I don' t know anything beyond that. If I unload vxlan the listening port goes away, but that is more trial and error.

root@compute01:/proc/net# netstat -nlp | egrep -- '4789|PID'
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 0.0.0.0:4789            0.0.0.0:*                           -
Proto RefCnt Flags       Type       State         I-Node   PID/Program name     Path
root@compute01:/proc/net#

My goal would be have some information about all kernel based listeners, hopefully beyond it's the kernel listening (it's the nfs subsystem, vxlan, whatever else).

Please CC me on all replies as I'm not subscribed.

                 reply	other threads:[~2023-04-25 15:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR01MB2812871BCF7C026223782698AC649@DM5PR01MB2812.prod.exchangelabs.com \
    --to=john@spikefishsolutions.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®