appneta / tcpreplay

Pcap editing and replay tools for *NIX and Windows - Users please download source from
http://tcpreplay.appneta.com/wiki/installation.html#downloads
1.17k stars 268 forks source link

[Bug] tcpreplay on Debian 12 does not seem to work on tap interfaces #828

Closed Zlika closed 3 months ago

Zlika commented 11 months ago

On Debian 11 (tcpreplay 4.3.3) I used the following procedure to replay a pcap file on a tap interface:

sudo ip tuntap add mode tap tap0
sudo ip addr add 10.11.12.1/24 dev tap0
sudo ip link set dev tap0 up

sudo tcpreplay -i tap0 --stat=1 file.pcap

I was then able to capture the replay on the same computer using Wireshark, listening on the tap0 interface.

I've just migrated to Debian 12 (tcpreplay 4.4.3) and this is not working anymore. I can still create the tap0 interface and run tcpreplay without any error, but Wireshark does not capture anything on the tap0 interface. I don't know if it is a bug of tcpreplay or if something has changed elsewhere in Debian networking stack, but I don't know how to debug this problem. Thank you for your help.

Zlika commented 3 months ago

Notes:

Thank you for your help.

Zlika commented 3 months ago

I used git bisect and found the culprit:

commit 0d6b6bc62483e544c4dbb600186d66c04838337e
Author: Fred Klassen <fklassen@appneta.com>
Date:   Sun Apr 25 16:13:23 2021 -0700

    Bug #411 #651 - don't create tap0 if it already exists

 docs/CHANGELOG          |  1 +
 src/common/sendpacket.c | 12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
fklassen commented 3 months ago

Thanks for digging into this. Targeting for 4.5.0

fklassen commented 3 months ago

Fixed in PR #874

Zlika commented 3 months ago

Hi @fklassen. I've tested branch 4.5.0-beta1 and the problem seems to be still here.

Zlika commented 3 months ago

False alarm... I was using the default tcpreplay binary from Debian instead of the local one :-) The new version solves the problem, thanks!