Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Zlika opened this issue Oct 21, 2023 · 6 comments
Closed

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

Zlika opened this issue Oct 21, 2023 · 6 comments
Assignees
Labels

Comments

@Zlika
Copy link

Zlika commented Oct 21, 2023

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
Copy link
Author

Zlika commented Jun 7, 2024

Notes:

  • The tcpreplay replay + wireshark recording is working if I use the lo (loopback) interface, so this is a tap-specific problem.
  • I have the same problem with the latest tcpreplay version (4.4.4) compiled from sources (the ./configure phase shows: "Tuntap device support: yes").
  • After reading tcpreplay fails to open already allocated tap0 device #411 I tried to use another name for the tap interface (not starting with "tap"), but same problem.

Thank you for your help.

@Zlika
Copy link
Author

Zlika commented Jun 7, 2024

I used git bisect and found the culprit:

commit 0d6b6bc62483e544c4dbb600186d66c04838337e
Author: Fred Klassen <[email protected]>
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
Copy link
Member

fklassen commented Jun 7, 2024

Thanks for digging into this. Targeting for 4.5.0

@fklassen fklassen self-assigned this Jun 7, 2024
@fklassen fklassen added the bug label Jun 7, 2024
@fklassen
Copy link
Member

fklassen commented Jun 8, 2024

Fixed in PR #874

@fklassen fklassen closed this as completed Jun 8, 2024
@Zlika
Copy link
Author

Zlika commented Jun 9, 2024

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

@Zlika
Copy link
Author

Zlika commented Jun 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants