-1

Does anybody know how can I find out what's the interface a packet arrived on? I captured packets with tcpdump using "-i any" and now I want to find out on what interface a certain packet was received. And another question, can I start tcpdump on an interface that does not exist yet? The code I am testing creates an interface and starts sending packets imediately. The problem is that by the time I get to hit tcpdump, some packets are already sent.

Thanks!

Irina
  • 3
  • 1

1 Answers1

1

I think we cannot do that on a interface which is not in network .. we can work on packets which flies in the network so the Ethernet should be in network

dinu1389
  • 138
  • 2
  • 9
  • 1
    I solved the problem in a different manner. I made a script that checked in a while loop if the interface has been created. Once the interface is created, I started the capture. This is the script, if anybody needs it: while [ -n $(ifconfig | grep interface)] do usleep 1 done tcpdump -i interface -s 0 -w ~/capture.cap – Irina Jul 19 '13 at 13:47