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

Pktgen won't run in background #279

Open
racompton opened this issue Aug 20, 2024 · 7 comments
Open

Pktgen won't run in background #279

racompton opened this issue Aug 20, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@racompton
Copy link

I need to run pktgen in the background without displaying the CLI. I want to execute pktgen on numerous servers at once from a centralized controller. It doesn't seem to work if I add > /dev/null 2>&1 & at the end of the pktgen command.

@KeithWiles
Copy link
Collaborator

The -G or -g host:port options was how I was handling running Pktgen in background without the CLI and waiting for Lua scripts. Look at the README file or use pktgen --help

@racompton
Copy link
Author

racompton commented Aug 21, 2024

Thanks for the reply. I am able to use the -G or -g options to run pktgen in the background but I don't understand what Lua script to send to the pktgen daemon to start the replay of a packet capture using a command file. Any help you can provide?

The command that I'm using the execute the pcap playback is:
pktgen -- -T -P -m "2.[0]" -m "2.[1]" -s 0:ACK-Flood-spoofed.pcap -s 1:ACK-Flood-spoofed.pcap -f start-2-pcap.pkt

The file start-2-pcap.pkt contains the following:

enable 0 pcap
set 0 rate 100
start 0
enable 1 pcap
set 1 rate 100
start 1

@KeithWiles
Copy link
Collaborator

You are using standard CLI commands and not Lua. To enable pktgen to be built with Lua you must install Lua from Lua.org or via you package manager for your Linux. To build pktgen with Lua support the command is make buildlua If you look at the README file and search for socat I show some examples. The CLI commands you are using will not work with the -G or -g option. The test and script directories have a few Lua script files.

@racompton
Copy link
Author

Thanks again for the quick reply. I now have Lua support complied. Can the packet capture file be dynamically updated via Lua? I want to be able to run pktgen in the background and dynamically specify different packet capture files to be replayed and change their rates without having to manually restart pktgen.

@KeithWiles
Copy link
Collaborator

sorry, currently that can not be done.

@racompton
Copy link
Author

Feature request? 🙏

@KeithWiles KeithWiles added the enhancement New feature or request label Aug 29, 2024
@KeithWiles
Copy link
Collaborator

I do not know when I will be able to add this feature, so it could be a while, but you are welcome to create a PR and add the feature yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants