I want to generate UDP packet to test a program, something equivalent to using telnet to test TCP port (Can telnet generate UDP packet?)

How can I do this?

link|improve this question

53% accept rate
feedback

1 Answer

up vote 4 down vote accepted

One word: Netcat

Netcat is the go-to tool for this sort of thing.

You can thrash whatever port you choose with udp packets with something like:

nc -u host.example.com 53 << /dev/random

(53 is your port number)

Or you can send an actual file, or tell it to bind that port and listen as a service, or whatever you like.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.