How to test open UDP ports

UDP Ports

You’ve opened a UDP ports on your server but not sure how to check if you can reach it from the outside.

When testing TCP ports, you can check with tools like nmap or nc only from the outside, but the nature of UDP is that it doesn’t send anything back so you need to monitor the port on the receiving server to see if you receive any packets from the remote server.

You can do this easily using tcpdump and nc.

First, log into the server with the open port. Let’s say we opened 80.

Fire up tcpdump to listen on em1 (or whatever interface is listening), specifying UDP and port 80:

Code:

-i is interface
-vv is extra verbose
-X prints data of each packet

Next, use nc from a remote server to throw some UDP packets in the direction of the server on port 80:

Code:

-u specifies UDP
$server here is the IP or hostname of your server

Now, on the sending machine, type some text. We’ll run through it below.

Sending machine:

Code:

Receiving machine:

Code:

This shows that we can type data into nc on the sending machine and send it via UDP to the receiving machine, and view the data successfully.

So yes, the port is open and you can move on to your next task :)

Please respond below if you have any questions or would like more details on this short howto.

Was this post helpful?
Let us know, if you liked the post. Only in this way, we can improve us.
Yes
No

Leave A Comment?

This site uses Akismet to reduce spam. Learn how your comment data is processed.