WMware – netcat – testing connectivity

To check if a port is open on VM

nc -z 80
Connection to 80 port [tcp/http] succeeded! 

check if UDP port is open:

 nc -z -u 53
Connection to 53 port [udp/domain] succeeded! 

Send data between hosts:
Host 1 ( set to listen mode:

nc -lp 1234

Host 2 send data to host 1

nc 1234
test 123

If the port (1234) is open the text (test 123) will be displayed in the console. This trick can be used a simple chat

The same can be used to send for example a log or a text file using this syntax:

nc 1234 < /var/log/vmkernel.log

this way content of that file will be displayed on Host 1 (if conditions specified above are met).

Leave a Reply

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

four − three =

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