1

I want to find out why some of my routing rules are not working and where my packet takes a "wrong" turn.

Is it possible to listen to a Port ( 22 in my case ) and then follow an incomming packet ?

What is especially important for me is that I can write to a log which Route is chosen when the packet gets sent out.

How could I do this?

MoonSweep
  • 388
b-m-f
  • 965
  • 2
  • 12
  • 22

1 Answers1

1

Before you start, this is a complex task and you need to have in-depth knowledge of the TCP/IP protocol so if you don't own this book already, buy it!

Depending on where the packets take a wrong turn, you will have to: (increasing number means increased difficulty)

  1. Use gufw's listening report:

    enter image description here

    to see whether the packets actually arrive to your machine. This is the simplest way of seeing what's going on.

  2. Use sudo tcpdump -i interface to have an even deeper knowledge what's happening on your machine...

  3. Sniff your network using something like wireshark to see the packets that actually get transported on the LAN and which are never responded to. The last one needs 2 machines: the "sniffing machine" that sniffs the network that the other machine is connected to. Also, you need to enable a monitor port on your switch (a.k.a. "mirroring port" or "SPAN" port) or use an old-style HUB.

The last one will allow you to follow the entire path of the packet (which is what your question is about)

For further information, read the manuals of the respective tools otherwise you will be like a kid trying to figure out an old-fashioned phone! >:-)

Fabby
  • 34,259
  • Don't thank me! ;-) If you like my answer, just click the little grey under the "0" now turning it into beautiful green. If you do not like my answer, click on the little grey down-arrow below the 0, and if you really like my answer, click on the little grey checkmark and the little up-arrow... If you have any further questions, go to http://askubuntu.com/questions/ask – Fabby Mar 20 '15 at 20:37