All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ajay Garg <ajaygargnsit@gmail.com>
To: netdev@vger.kernel.org
Subject: Packet Sniffing on Intermediate Nodes
Date: Mon, 10 May 2021 22:02:53 +0530	[thread overview]
Message-ID: <CAHP4M8Va9TuFycrVZmLwBnuPtDRykX__NOxxF9zq0089JJBACA@mail.gmail.com> (raw)

Hi All,

I have been playing around with sniffing packets, using raw sockets.

Following is my setup :

* Machine-1 (Sender), with IP 1.2.3.4
* Machine-2 (Intermediate), with IP 5.6.7.8
* Machine-3 (Receiver), with IP 9.10.11.12

The packet-path is Machine-1 <=> Machine-2 <=> Machine-3.
I have an agent installed, one each on all the 3 machines,
communicating on port 12345.

Following is what I have accomplished so far :

1.
I have been able to do communication over raw-sockets.
Most importantly, Machine-3 (Receiver) is able to receive the packets
from Machine-1, via raw-socket paradigm.

2.
Now, raw sockets in general accept all packets.
So, the next step was to apply socket-flitering, so that only packets
intended for port 12345 are received on Machine-3 agent.

This was accomplished via the help from
https://www.kernel.org/doc/Documentation/networking/filter.txt

3.
Now, I intend to sniff packets on Machine-2 (the intermediate node).

Is there a normal / legal way to do this?
Would be grateful for any pointers.


Thanks and Regards,
Ajay

             reply	other threads:[~2021-05-10 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 16:32 Ajay Garg [this message]
2021-05-10 17:46 ` Packet Sniffing on Intermediate Nodes Ajay Garg

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=CAHP4M8Va9TuFycrVZmLwBnuPtDRykX__NOxxF9zq0089JJBACA@mail.gmail.com \
    --to=ajaygargnsit@gmail.com \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.