The following works on MacOS, details may vary on Linux distros or other Unix (for example SUSE SLES has netcat not nc)

Create a UDP listener on a specific port:

  $ nc -ul 2122

Check if the port is open:

  $ netstat -an| grep 2122
  udp4       0      0  127.0.0.1.2122         127.0.0.1.51247

Check if the UDP port is reachable from another machine:

  $ nc -vnzu 192.168.0.14 212
  found 0 associations
  found 1 connections:
       1: flags=82<CONNECTED,PREFERRED>
    outif (null)
    src 192.168.0.14 port 53601
    dst 192.168.0.14 port 212
    rank info not available

  Connection to 192.168.0.14 port 212 [udp/*] succeeded!
      Connection to IP port 2122 [udp/*] succeeded!

Spray that port with packets:

  $ nc -u IP 2122 < /dev/random

Click here for a serverfault post on the subject