How to Udp Telnet with Netcat

By | July 27, 2020

The standard telnet utilities that are present in linux or windows can connect to services running on TCP ports.

They do not support udp ports. However the utility netcat can be used to connect and work with udp ports in the same way as the telnet command.

The telnet command can connect to a host on a specified port with the following command:

$ telnet localhost 7000

In the above example localhost is the hostname and 7000 is the port number.

Connect to UDP Ports

If you need to connect to udp ports on a certain host, use the netcat command. For udp ports the syntax for netcat is very similar to telnet.

$ netcat localhost 7000 -u

The "-u" option connects to udp port.

Notes

Besides tcp and udp, the netcat command can also connect to other socket types like unix-domain sockets.

To learn more about the netcat command, check the man page by running the command "man netcat".

The manual pages can also be found online at:
https://linux.die.net/man/1/nc

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

Leave a Reply

Your email address will not be published. Required fields are marked *