I want to test snort, so I want to have some test network traffic. Since snort can read pcap files, I want to generate some traffics which can be customized and save it to pcap files. Here are my questions:

  1. Is it right to test snort as I said?

  2. Is there a good tool to generate traffic and save it to pcap file?

    Any suggestions about what I going to do means a lot to me!

  • tcpdump is able to generate pcap files for you. Dec 4, 2016 at 8:28
  • One more question, is Scapy OK? @RuiFRibeiro Dec 4, 2016 at 14:58
  • Scapy is a very interesting library for people who has programming abilities. No idea if it generates pcap files easily. Dec 4, 2016 at 14:59

1 Answer 1


tcpdump works very well, but can have an issue if you create your pcap incorrectly.

tcpdump -i ens18 -w example.pcap

-i specifies the interface and mine was ens18; -w specifies the file.

Note there are no limits set to this tcpdump, meaning you have to Ctrl + c to complete it.

Instead of manually stopping you could use -C for file size limit or -c for packet count.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .