Go to main content

Administering TCP/IP Networks, IPMP, and IP Tunnels in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020

Performing TCP and UDP Administration With the netcat Utility

Use the netcat (nc) utility to perform a variety of tasks that are associated with TCP or UDP administration. You can use the command for both IPv4 and IPv6 networks. The utility enables you to perform the following tasks:

  • Open TCP connections

  • Send UDP packets

  • Listen on arbitrary TCP and UDP ports

  • Perform port scanning

The utility's –M option enables you to specify per socket Service Level Agreement (SLA) properties. When you use the option while setting other properties, a MAC flow for the socket is created. For example:

$ nc -M maxbw=50M host.example.com 7777
$ nc -l -M priority=high,inherit=on 2222

Some installation methods do not install the netcat software package by default. Check whether the package is installed on your system as follows:

$ pkg list network/netcat

If the package is not installed, install it as follows:

$ pkg install pkg:/network/netcat

For reference, see the netcat(1) man page.