Although is pretty easy to write a perl/python script to send UDP data, I wanted to be able to send a UDP message from the command line to test some code quickly. After 15 seconds of googling I found the awesome command “sendip”. After a minute of reading the man page I got what I needed:

sendip -p ipv4 -is 192.168.1.81 -p udp -us 5070 -ud 5060 -d "Hello" -v 192.168.1.81 sendip -p ipv4 -is 192.168.1.81 -p udp -us 5070 -ud 5060 -d "Hello" -v 192.168.1.81

This should send a “Hello” message over udp to port 5060 using an ipv4 address.

Here the result:

Added 26 options Initializing module ipv4 Initializing module udp Finalizing module udp Finalizing module ipv4 Final packet data: 45 00 00 21 E.. ! 34 E0 00 00 4 ... FF 11 02 F9 .... C0 A8 01 51 ...Q C0 A8 01 51 ...Q 13 CE 13 C4 .... 00 0D 30 7D .. 0 } 48 65 6C 6C Hell 6F o Sent 33 bytes to 192.168.1.81 Freeing module ipv4 Freeing module udp Added 26 options Initializing module ipv4 Initializing module udp Finalizing module udp Finalizing module ipv4 Final packet data: 45 00 00 21 E..! 34 E0 00 00 4... FF 11 02 F9 .... C0 A8 01 51 ...Q C0 A8 01 51 ...Q 13 CE 13 C4 .... 00 0D 30 7D ..0} 48 65 6C 6C Hell 6F o Sent 33 bytes to 192.168.1.81 Freeing module ipv4 Freeing module udp

It is pretty awesome that you can build about any protocol packet for quick testing using just bash …