InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Networking tutorials

  • DIG quick start tutorial
  • Dig - list all dns records
  • How to view wifi connection speed on Mac
  • Linux iptables - Nat port forwarding using PREROUTING
  • Linux iptables and ip6tables examples
  • Ngrep - quick start guide
  • Use nc to check if a remote port is reachable
  • Use nc to listen to tcp or udp port
  • Use nc to test HTTP url redirection
  • add more DNS servers to Wi-Fi interface on Mac
  • locally override website host to IP mapping
  • use nc to print headers from browser
 
  • Home
  • > Tutorials
  • > Networking

Use netcat (nc) to check if a remote port is reachable

on Jun 19, 2016

Netcat (nc) can be use to check if a remote port is reachable and client can connect to it. The following commands were tried on Mac and Ubuntu Linux.

Checking tcp port

Use -t (tcp), -v (verbosity) and -z (to scan the port without sending any data).

$ nc -tvz google.co.in 80
found 0 associations
found 1 connections:
     1:	flags=82
	outif en1
	src 192.168.100.103 port 57068
	dst 216.58.197.35 port 80
	rank info not available
	TCP aux info available

Connection to google.co.in port 80 [tcp/http] succeeded!

Checking udp port

$ nc -uvz google.co.in 80
found 0 associations
found 1 connections:
     1:	flags=82
	outif (null)
	src 192.168.100.103 port 64555
	dst 216.58.197.67 port 80
	rank info not available

Connection to google.co.in port 80 [udp/http] succeeded!

Suggested posts:

  1. CSS – enlarge image on hover
  2. Use x2go to access remote Ubuntu Linux
  3. Linux what package provides a file
  4. How to migrate wordpress from root to sub directory
  5. How to monitor 404 pages on your site
  6. How to connect to mysql server using ssh port forwarding
  7. Install google camera on Asus m1 max pro
  8. CSS – use :before to add heading to a div
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Networking, Tutorials, Webmaster
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress