Using netcat to ascertain if a particular port is open between sender and receiver

Overview

The utility netcat can be used to ascertain if a particular TCP or UDP port is open between two endpoints. This can be extremely useful for determining whether a connection can be made between an Aspera client and server.

Obtaining netcat

 

Instructions

Ensure netcat is available on both computers you are testing with.

With netcat you first set up one computer to be the "listener", listening on a specific port. You then try to connect to the listening computer on the same port from the other computer.

To test just do the following:

STEP 1

Connect to both local and remote computer. Make sure the netcat files are present on both computers.

STEP 2

On your Aspera server open up a command prompt and navigate to the directory with netcat. Then type in:

nc -l -u -p 33001

-l means it should listen, -u that it should use UDP and -p specifies the port.

STEP 3

Now try and connect from the remote machine. Open up a command prompt and navigate to the directory with netcat. Use the following command, where ip_address is the IP address of your Aspera server:

nc -u ip_address 33001

STEP 4

If your connection was successful you should now be able to type something on the remote machine and see the same echoed on the listening machine.

If the port is blocked you will be able to type something on the remote machine but you will not see anything appear on the listening machine.

STEP 5 (optional)

You should also try netcat with a port you know works and is open, just for verification. For example, to test TCP/33001:

nc -l -p 33001 # on the listening server
nc ip_address # 33001 on the remote machine
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk