Windows Server has become more powerful than ever with the release of Windows Server 2019 across all functionalities and components. However, with network troubleshooting and connectivity testing, it still often comes down to a few basic command-lines that can help identify and troubleshoot problems.

In this post, we will take a look at the top 5 Windows Server network commands that are used for troubleshooting network and connectivity issues.

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!

Top 5 Windows Server Network Commands

As advanced as today’s operating systems have become, it can come down to a few very powerful networking commands that will help to troubleshoot an issue and pinpoint the source of a network problem.

Let’s look at the following network troubleshooting command lines and see how they can be used to effectively troubleshoot network and connectivity issues in a Windows Server environment.

  1. Ping
  2. Pathping
  3. Tracert
  4. Telnet
  5. Test-NetConnection

Ping

Download Banner

There is perhaps no more widely known network command than ping.

Ping is the quintessential utility for determining if a network resource is reachable. This can bring to light network problems at layer 1, 2, and 3. Also potential firewall issues in between the two nodes the ping packets are being exchanged.

Ping is perhaps the first command that will be used in a Windows Server environment to troubleshoot a supposed network connectivity issue between two network nodes and an absolutely fundamental command across just about any operating system.

Below shows the usage of the command as well as the command-line options that can be used in conjunction with the basic ping functionality.

Usage: ping

[-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] [-R] [-S srcaddr] [-c compartment] [-p] [-4] [-6] target_name

Options:

-t Ping the specified host until stopped.
To see statistics and continue – type Control-Break;
To stop – type Control-C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don’t Fragment flag in packet (IPv4-only).
-i TTL Time To Live.
-v TOS Type Of Service (IPv4-only) – This setting has been deprecated and has no effect on the type of service field in the IP Header.
-r count Record route for count hops (IPv4-only).
-s count Timestamp for count hops (IPv4-only).
-j host-list Loose source route along host-list (IPv4-only).
-k host-list Strict source route along host-list (IPv4-only).
-w timeout Timeout in milliseconds to wait for each reply.
-R Use routing header to test reverse route also (IPv6-only). Per RFC 5095 the use of this routing header has been deprecated. Some systems may drop echo requests if this header is used.
-S srcaddr Source address to use.
-c compartment Routing compartment identifier.
-p Ping a Hyper-V Network Virtualization provider address.
-4 Force using IPv4.
-6 Force using IPv6.

Pathping

Consider the pathping command to be the ping command for the entire route in between the source and endpoint and not just the ICMP reply from the endpoint.
Pathping has been described as tracert + ping and that is a fairly good description as it shows the health of the routes in between.

Usage: pathping [-g host-list] [-h maximum_hops] [-i address] [-n] [-p period] [-q num_queries] [-w timeout] [-4] [-6] target_name

Options:

-g host-list Loose source route along host-list.
-h maximum_hops Maximum number of hops to search for the target.
-i address Use the specified source address.
-n Do not resolve addresses to hostnames.
-p period Wait period milliseconds between pings.
-q num_queries Number of queries per hop.
-w timeout Wait timeout milliseconds for each reply.
-4 Force using IPv4.
-6 Force using IPv6.

Tracert

What is the tracert or “trace route” command?

The tracert command in Windows sheds light on the actual router “hops” in between the source and destination computer endpoint. Tracert shows these hops or routes and allows seeing the various networks and transit points your traffic travels across to arrive at the destination.
It is a great utility for troubleshooting routing issues or gateway problems in Windows Server.

Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name

Options:

-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for the target.
-j host-list Loose source route along host-list (IPv4-only).
-w timeout Wait timeout milliseconds for each reply.
-R Trace round-trip path (IPv6-only).
-S srcaddr Source address to use (IPv6-only).
-4 Force using IPv4.
-6 Force using IPv6.

Telnet

Telnet is another Windows Server network command-line that is often used to effectively troubleshoot connectivity issues.

While its design and purpose are for remote access of systems and interaction with those, telnet is a great network command-line utility for testing general connectivity to a port. Telnet can be used to effectively test to see whether or not a remote port is listening which is a great way to troubleshoot general connectivity issues to a specific application port.

An example of testing connectivity to a SQL port on a particular server: telnet 1433. This instructs telnet to connect to the remote server specified on the port that follows in the command.

telnet [-a][-e escape char][-f log file][-l user][-t term][host [port]] -a Attempt automatic logon. Same as -l option except uses the currently logged on user’s name.
-e Escape character to enter telnet client prompt.
-f File name for client-side logging
-l Specifies the user name to log in with on the remote system. Requires that the remote system support the TELNET ENVIRON option.
-t Specifies terminal type. Supported term types are vt100, vt52, ansi and vtnt only.
host Specifies the hostname or IP address of the remote computer to connect to.
port Specifies a port number or service name.

Test-NetConnection

The Test-NetConnection cmdlet displays diagnostic information for a connection.

It supports ping test, TCP test, route tracing, and route selection diagnostics. Depending on the input parameters, the output can include the DNS lookup results, a list of IP interfaces, IPsec rules, route/source address selection results, and/or confirmation of connection establishment.

Running the Test-NetConnection PowerShell cmdlet to test HTTP connectivity

Running the Test-NetConnection PowerShell cmdlet to test HTTP connectivity

SYNOPSIS

Displays diagnostic information for a connection.

SYNTAX

Test-NetConnection [[-ComputerName] ] [-CommonTCPPort] {HTTP | RDP | SMB | WINRM} [-InformationLevel {Quiet | Detailed}] []

Test-NetConnection [[-ComputerName] ] [-Hops ] [-InformationLevel {Quiet | Detailed}] [-TraceRoute] []

Test-NetConnection [[-ComputerName] ] [-InformationLevel {Quiet | Detailed}] -Port []

Test-NetConnection [-ConstrainInterface ] [-ConstrainSourceAddress ] -DiagnoseRouting []

Concluding Thoughts

As advanced as the modern Windows Server operating systems have become, there is still tremendous value to be gained by knowing and using the top 5 Windows Server network command lines mentioned in the post.

This is by no means a comprehensive list of all the commands that may help to troubleshoot or resolve a network issue. However, the five commands mentioned are some of the most fundamental network utilities included in Windows that will help to pinpoint most network connectivity issues encountered.

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

Rate this post