I have a device which sends data to my PC over UDP. I want to write parser for this data and want to do it without the device. For achieving that I've created pcap dump of arriving data using tcpdump as follows:
sudo tcpdump -i etho0 -s 0 -w data.pcap udp
After that I've checked, that the file was correctly created by opening it in Wireshark.
As one can see, the device has IP address 192.168.1.130 and my PC has IP 92.168.1.111, all data are delivered using UDP.
Now I want to replay this dump using tcpreplay utility. I do it as follows:
sudo tcpreplay -i eth0 data.pcap
after doing that I launch Wireshark and listen for the data on eth0. I'm awaiting that the data from the pcap file will appear in Wireshark, but there are no data at all. Why? How to use tcpreplay correctly?
I found the cause of the problem. After disconnecting the device my eth0 interface became down. After I up-ed it and assigned IP 192.168.1.111 all has began to work