cmd Checking network configuration


Checking network configuration in the Windows Command Prompt (cmd) is essential for diagnosing network issues, understanding your network setup, and managing network connections. Various commands can help you retrieve information about your network settings, including IP address, subnet mask, default gateway, and more. Below, I’ll explain some of the most commonly used commands for checking network configuration, along with examples and expected outputs.

1. Using the ipconfig Command

The ipconfig command displays the current IP address, subnet mask, and default gateway for all network interfaces on your computer.

Basic Syntax:

ipconfig

Example:

To view your network configuration, enter:

ipconfig

Output:

C:\Users\YourUsername>ipconfig Windows IP Configuration Ethernet adapter Ethernet: Connection-specific DNS Suffix . : example.com IPv4 Address. . . . . . . . . . . . : 192.168.1.10 Subnet Mask . . . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . . . . : 192.168.1.1 Wireless LAN adapter Wi-Fi: Connection-specific DNS Suffix . : IPv4 Address. . . . . . . . . . . . : 192.168.1.20 Subnet Mask . . . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . . . . : 192.168.1.1

2. Using the ipconfig /all Command

The ipconfig /all command provides detailed information about all network interfaces, including MAC addresses, DHCP settings, and DNS servers.

Basic Syntax:

ipconfig /all

Example:

To get comprehensive details about your network interfaces, enter:

ipconfig /all

Output:

C:\Users\YourUsername>ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : YOUR-PC Primary Dns Suffix . . . . . . . . : example.com Node Type . . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . . . : No WINS Proxy Enabled. . . . . . . . . . : No Ethernet adapter Ethernet: Connection-specific DNS Suffix . : example.com Description . . . . . . . . . . . . : Intel(R) Ethernet Connection (2) I219-V Physical Address. . . . . . . . . . . : 00-1A-2B-3C-4D-5E DHCP Enabled. . . . . . . . . . . . . : Yes DHCP Server . . . . . . . . . . . . . : 192.168.1.1 IPv4 Address. . . . . . . . . . . . . : 192.168.1.10 Subnet Mask . . . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . . . . : 192.168.1.1 DNS Servers . . . . . . . . . . . . . : 8.8.8.8 Lease Obtained. . . . . . . . . . . . . : October 29, 2024 10:00:00 AM Lease Expires . . . . . . . . . . . . . : October 30, 2024 10:00:00 AM

3. Using the ping Command

The ping command is used to test connectivity to another network device or website. It sends ICMP Echo Request messages to the target and displays the responses.

Basic Syntax:

ping [hostname or IP address]

Example:

To check connectivity to Google's DNS server, enter:

ping 8.8.8.8

Output:

C:\Users\YourUsername>ping 8.8.8.8 Pinging 8.8.8.8 with 32 bytes of data: Reply from 8.8.8.8: bytes=32 time=14ms TTL=117 Reply from 8.8.8.8: bytes=32 time=13ms TTL=117 Reply from 8.8.8.8: bytes=32 time=12ms TTL=117 Reply from 8.8.8.8: bytes=32 time=13ms TTL=117 Ping statistics for 8.8.8.8: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 12ms, Maximum = 14ms, Average = 13ms

4. Using the tracert Command

The tracert command (short for "trace route") shows the path that packets take to reach a specific destination. It displays each hop along the route and the time taken for each.

Basic Syntax:

tracert [hostname or IP address]

Example:

To trace the route to google.com, enter:

tracert google.com

Output:

C:\Users\YourUsername>tracert google.com Tracing route to google.com [172.217.6.206] over a maximum of 30 hops: 1 <1 ms <1 ms <1 ms YOUR-PC [192.168.1.10] 2 1 ms 1 ms 1 ms 192.168.1.1 3 10 ms 11 ms 10 ms 203.0.113.1 4 12 ms 12 ms 12 ms 10.0.0.1 5 13 ms 14 ms 13 ms 172.217.6.206 Trace complete.

5. Using the netstat Command

The netstat command provides information about network connections, routing tables, and network statistics.

Basic Syntax:

netstat

Example:

To view current network connections, enter:

netstat

Output:

C:\Users\YourUsername>netstat Proto Local Address Foreign Address State TCP 192.168.1.10:49152 google.com:80 ESTABLISHED TCP 192.168.1.10:49153 example.com:443 TIME_WAIT

Summary

The Windows Command Prompt offers several commands for checking network configuration, including ipconfig, ping, tracert, and netstat. These commands allow you to view IP addresses, test connectivity, trace routes to other devices, and monitor network connections. Understanding how to use these commands can help you effectively diagnose and troubleshoot network issues.