Below is a list of 10 essential Windows network commands, along with their descriptions and
illustrative examples. These commands are executed in the Windows Command Prompt
(CMD) to troubleshoot, configure, or monitor network-related activities. Each command is
accompanied by a brief explanation and an example to demonstrate its usage.
1. ping
Description: Tests the connectivity between the local computer and a remote host by sending
ICMP echo requests and receiving replies. It helps verify if a remote device is reachable and
measures round-trip time.
Example:
ping google.com
Output Illustration:
Pinging google.com [142.250.190.78] with 32 bytes of data:
Reply from 142.250.190.78: bytes=32 time=25ms TTL=117
Reply from 142.250.190.78: bytes=32 time=24ms TTL=117
Reply from 142.250.190.78: bytes=32 time=26ms TTL=117
Reply from 142.250.190.78: bytes=32 time=25ms TTL=117
Ping statistics for 142.250.190.78:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 24ms, Maximum = 26ms, Average = 25ms
Explanation: The command pings `google.com`, sending four packets and receiving replies,
indicating the host is reachable with an average latency of 25ms.
2. ipconfig
Description: Displays the IP configuration details of all network adapters on the system,
including IP address, subnet mask, and default gateway.
Example:
ipconfig
Output Illustration:
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : example.com
IPv4 Address. . . . . . . . . . . : 192.168.1.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Explanation: Shows the IP configuration for the Ethernet adapter, including the assigned IP
address (`192.168.1.100`) and default gateway.
3. ipconfig /all
Description: Provides detailed IP configuration information, including DNS servers, MAC
address, and DHCP status, for all network adapters.
Example:
ipconfig /all
Output Illustration:
Windows IP Configuration
Host Name . . . . . . . . . . . . : DESKTOP-XYZ
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Ethernet:
Physical Address. . . . . . . . . : 00-14-22-01-23-45
DHCP Enabled. . . . . . . . . . . : Yes
IPv4 Address. . . . . . . . . . . : 192.168.1.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
DNS Servers . . . . . . . . . . . : 8.8.8.8
Explanation: Displays detailed network adapter information, including the MAC address and
DNS server.
4. tracert
Description: Traces the route packets take to a network host, showing each hop and latency.
Useful for diagnosing where network delays or failures occur.
Example:
tracert google.com
Output Illustration:
Tracing route to google.com [142.250.190.78]
over a maximum of 30 hops:
1 2 ms 1 ms 1 ms 192.168.1.1
2 8 ms 7 ms 8 ms 10.0.0.1
3 15 ms 14 ms 15 ms isp-router.example.com [203.0.113.1]
4 25 ms 24 ms 25 ms 142.250.190.78
Trace complete.
Explanation: Shows the path from the local machine to `google.com`, listing each router
(hop) and the time taken.
5. nslookup
Description: Queries DNS servers to resolve domain names to IP addresses or retrieve DNS
records.
Example:
nslookup google.com
Output Illustration:
Server: dns.google
Address: 8.8.8.8
Non-authoritative answer:
Name: google.com
Address: 142.250.190.78
Explanation: Resolves the IP address of `google.com` using the DNS server `8.8.8.8`.
6. netstat
Description: Displays active network connections, listening ports, and network statistics.
Example:
netstat -an
Output Illustration:
Active Connections
Proto Local Address Foreign Address State
TCP 192.168.1.100:135 0.0.0.0:0 LISTENING
TCP 192.168.1.100:49152 142.250.190.78:443 ESTABLISHED
UDP 192.168.1.100:123 *:*
Explanation: Lists all active connections and listening ports, with `-a` showing all
connections and `-n` displaying numerical addresses.
---
7. arp -a
Description: Displays the Address Resolution Protocol (ARP) cache, mapping IP addresses to
MAC addresses for devices on the local network.
Example:
arp -a
Output Illustration:
Interface: 192.168.1.100 --- 0x2
Internet Address Physical Address Type
192.168.1.1 00-14-22-01-23-45 dynamic
192.168.1.101 00-16-17-22-33-44 dynamic
Explanation: Shows the IP-to-MAC address mappings for devices in the local network.
8. route print
Description: Displays the routing table, showing how packets are routed to different network
destinations.
Example:
route print
Output Illustration:
IPv4 Route Table
==================================================================
=========
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.100 25
192.168.1.0 255.255.255.0 On-link 192.168.1.100 281
Explanation: Lists routing rules, including the default gateway (`192.168.1.1`) for internet
traffic.
9. netsh interface show interface
Description: Displays the status of network interfaces, including whether they are enabled or
disabled.
Example:
netsh interface show interface
Output Illustration:
Admin State State Type Interface Name
-------------------------------------------------------------------------
Enabled Connected Dedicated Ethernet
Disabled Disconnected Dedicated Wi-Fi
Explanation: Shows the status of network interfaces, indicating the Ethernet interface is
connected.
10. netsh wlan show profiles
Description: Lists all saved Wi-Fi profiles on the system, useful for managing wireless
network connections.
Example:
netsh wlan show profiles
Output Illustration:
Profiles on interface Wi-Fi:
Group policy profiles (read only)
<None>
User profiles
All User Profile : HomeWiFi
All User Profile : OfficeWiFi
Explanation: Displays the names of saved Wi-Fi networks, such as `HomeWiFi`.
11. getmac
Description: Displays the MAC (Media Access Control) address of the network adapters on
the system.
Example:
getmac
Output Illustration:
Physical Address Transport Name
===================
==========================================================
00-14-22-01-23-45 \Device\Tcpip_{12345678-1234-1234-1234-1234567890AB}
Explanation: Lists the MAC address of the network adapter.
12. pathping
Description: Combines features of `ping` and `tracert` to provide detailed information about
packet loss and latency at each hop.
Example:
pathping google.com
Output Illustration:
Tracing route to google.com [142.250.190.78]
over a maximum of 30 hops:
0 DESKTOP-XYZ [192.168.1.100]
1 192.168.1.1
2 isp-router.example.com [203.0.113.1]
3 142.250.190.78
Computing statistics for 75 seconds...
Source to Here This Node/Link
Hop RTT Lost/Sent = Pct Lost/Sent = Pct Address
0 DESKTOP-XYZ [192.168.1.100]
0/ 100 = 0% |
1 2ms 0/ 100 = 0% 0/ 100 = 0% 192.168.1.1
0/ 100 = 0% |
2 15ms 0/ 100 = 0% 0/ 100 = 0% isp-router.example.com [203.0.113.1]
0/ 100 = 0% |
3 25ms 0/ 100 = 0% 0/ 100 = 0% 142.250.190.78
Explanation: Shows the route to `google.com` and statistics on packet loss and latency at
each hop.
Notes:
- How to Run: Open Command Prompt by typing `cmd` in the Windows search bar and
pressing Enter. Type the commands as shown.
- Permissions: Some commands (e.g., `netsh`) may require administrative privileges. Right-
click Command Prompt and select "Run as administrator."
- Real-Time Use: Commands like `ping`, `tracert`, and `pathping` rely on network
connectivity, so results depend on the network environment.
Latency refers to the time it takes for data to travel from one point to another in a network,
typically measured in milliseconds (ms). It represents the delay between sending a request
and receiving a response. In networking, latency is a critical factor affecting the performance
of applications, especially those requiring real-time interaction, such as online gaming, video
calls, or web browsing.
Transit time is the duration it takes for a data packet to travel from the sender to the receiver
(one-way) or for a request to travel to the destination and receive a response (round-trip). It is
closely related to latency, which often refers to the round-trip time (RTT) in tools like ping.
Transit time is influenced by:
Distance: Physical distance between source and destination.
Network Hops: Number of routers or devices the packet passes through.
Network Congestion: Traffic load on the network.
Medium: Type of connection (e.g., fiber, wireless, satellite).
What is Propagation Speed?
Propagation speed is the rate at which a signal (electromagnetic wave, electrical impulse, or
light pulse) travels through a medium. It depends on the medium’s properties and is always
slower than the speed of light in a vacuum (3 × 10⁸ m/s). Here’s how it varies by medium:
Copper Cables (e.g., Ethernet cables like Cat5e/Cat6):
o Propagation speed is approximately 2/3 the speed of light (~2 × 10⁸ m/s or
200,000 km/s).
o This is due to the electrical signal traveling through twisted-pair or coaxial
cables, slowed by the cable’s dielectric properties.
Fiber Optic Cables:
o Propagation speed is also ~2/3 the speed of light (~2 × 10⁸ m/s or 200,000
km/s).
o Light travels through the glass core, slowed by the refractive index of the fiber
(typically 1.5, reducing speed to ~2 × 10⁸ m/s).
Wireless (Air):
o Propagation speed is nearly the speed of light (~3 × 10⁸ m/s or 300,000 km/s).
o Radio waves travel through air or vacuum with minimal resistance, close to
the maximum speed of light.
Propagation Delay:
The time it takes for a signal to travel from the sender (e.g., India) to the receiver
(e.g., USA) through a physical medium (e.g., fiber optic cable).
Formula: Propagation Delay = Distance / Propagation Speed.
Depends on: Physical distance and the medium’s propagation speed (e.g., ~2 × 10⁸
m/s in fiber, ~2/3 the speed of light).
Data Transmission Time:
The time it takes to push all the bits of a data packet onto the network link.
Formula: Transmission Time = Data Size / Bandwidth.
Depends on: The size of the data (in bits) and the network’s bandwidth (in bits per
second, bps).