You may hear or used ping command to check response and
connectivity from any network nodes.
But what will you do if your IT Manager asks you to ping a
port and check if it is open or close?
Ping command is not able to check port connectivity and
status for troubleshooting purposes.
If your firewall blocks ICMP port then a ping will
not respond and the node will showdown as it is not responding to the ping,
however other services could be running.
Same on the other end it is possible that ping is ok, but the web the server will not responding on port 80
Then If one is want to ping a port and want to check a port
status open or close.
Question arouse that is it possible? If Yes then How?
Of course, it is possible and we are explaining here step by
step to check post status and ping a port.
Tcping Command
tcping is a command-line tool that can be used to check
that a TCP port is open or close.
The manual is on the same page.
How To Use TCPING Command
If you want to check port 443 and 80 status for google.com
Here we are using tcping to check port 443 at google.com.
As can be seen, the port status is open and responding if the port is not open
it will show as no response after 2000ms by default.
You could also use telnet to test for TCP connectivity to a
port, however, the tcping tool provides further features as outlined in the
usage section here.
Some such features include being able to continually run
the test allowing a way to generate traffic for you to watch out for in live
packet captures as well as the response time.
What about UDP?
As UDP is a connectionless protocol, As UDP does not
establish a connection we can’t just look for this to determine if the port is
responding, we instead need to send specific data and see if we receive a
response.
NMAP is a great tool for this, you can download it
and use it to port scan a destination address to determine what ports are open.
In this example we are querying if 8.8.8.8 is responding on
UDP port 53, as it serves DNS we would expect it to be open.
C:\Users\Admin\Desktop\nmap-6.47>nmap -sU -p 53 8.8.8.8
Nmap scan report for google-public-dns-a.google.com
(8.8.8.8)
Host is up (0.0050s latency).
PORT STATE SERVICE
53/udp open|filtered domain
Nmap done: 1 IP address (1 host up) scanned in 5.31 seconds
NMAP can also be used to check a TCP port is open in a
similar way, just change -sU to -sT.
Port not
responding
A firewall is blocking the traffic:
It is possible if there is a firewall and some rule on it
which block your intended port
The destination may not be listening on the port:
The destination you are trying to connect to may not have
any services listening on the port specified so there will not be any response.
This can also happen if a service has been stopped or hand out.
There is some other network problem between the source
and destination of the traffic:
There could be any number of network connectivity problems
between the source and destination
To Trace
Network Connectivity
You can check the connectivity along the path of the traffic
by running a packet capture with something like Wireshark or tcpdump.
this will show you where the traffic is getting through to
and where it’s being stopped along the route.
You could run it on the source and destination servers, as
well as devices in between that you have access to such as firewalls or
routers.
Follow the flow of traffic until you determine where the
problem is.
So, Tcping is a fabulous command to check port status and port
connectivity
0 Comments