Netcat to Test Connectivity
Need to test port connectivity between two hosts? Netcat to the rescue! Start the server on one host (port 1234 in this example)...
nc -l 1234
Then connect to it from the other host...
nc server-name 1234
Hopefully nothing should happen, but now anything you type into either end will be relayed to the other, showing the connection is ok.
Written by Rhodri Pugh
Related protips
3 Responses
Useful, thanks!
over 1 year ago
·
If you want to log UDP specifically, try nc -lu 1234
over 1 year ago
·
You can use the flag "-z" that closes the connection right after a successful attempt...
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Networking
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#