Sub topic 3
Checking your configuration with ipconfig
This chapter assumes you know what an IP address is, can open a command prompt, and know that devices reach other networks through routers. Before you test a path with ping or tracert, check what the computer itself believes about the network. ipconfig shows that, and it is the first command in most troubleshooting sessions.
What ipconfig reports
ipconfig is a Windows command that prints the IP configuration of each network adapter. Run it with no options for the short view.
ipconfigA typical Wi-Fi adapter section looks like this:
Wireless LAN adapter Wi-Fi:
Connection-specific DNS Suffix . : lan
IPv4 Address. . . . . . . . . . . : 192.168.1.42
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1Each field answers a different question:
| Field | Meaning | What to check |
|---|---|---|
| IPv4 Address | The address of this adapter | Is it present and in the expected range? |
| Subnet Mask | Which part of the address identifies the local network | Does it match the other devices on the LAN? |
| Default Gateway | The router that receives traffic for other networks | Is it present, and is it in the same subnet as your address? |
With the mask 255.255.255.0, every address from 192.168.1.1 to 192.168.1.254 is on your local network. Anything else is sent to the default gateway.
The detailed view
Add /all to see the fields that matter for DHCP and name resolution.
ipconfig
ipconfig /allipconfig /all adds these items:
- Physical Address: the adapter's MAC address.
- DHCP Enabled: whether the address came from a DHCP server (a service that hands out addresses automatically) or was typed in by hand.
- DHCP Server, Lease Obtained, and Lease Expires: which server gave the address, and for how long.
- DNS Servers: the servers the computer asks to turn names into IP addresses.
Spotting a bad configuration
Some results point to a fault immediately:
- An address starting with
169.254is an APIPA address (Automatic Private IP Addressing). Windows assigns one when it asks for a DHCP lease and gets no answer. The adapter can talk only to other devices on the same link, so check the cable, the Wi-Fi association, and the DHCP server. - No default gateway means the computer can reach its own subnet but nothing beyond it.
- A gateway outside your subnet, for example address
192.168.1.42/24with gateway10.0.0.1, means the settings are wrong. Packets for other networks can never reach the router. - "Media disconnected" means the adapter has no link at all.
- Missing or wrong DNS servers produce failures that look like "the internet is down" when only name lookups are broken. The chapter on pinging by address versus by name covers how to separate the two.
Refreshing the configuration
Three further options are common fixes after a configuration or name resolution problem.
ipconfig /release
ipconfig /renew
ipconfig /flushdns/releasegives up the current DHCP lease./renewasks the DHCP server for a new lease, which may bring a different address, gateway, or DNS server./flushdnsclears the local DNS resolver cache, so stale or wrong name-to-address entries are discarded.
Run /release and /renew together. After /release alone the adapter has no address, and a remote session will drop. These commands usually need an administrator command prompt.
Linux equivalent
Linux has no ipconfig. The ip command gives the same information.
ip addr show
ip route showip addr show lists addresses and masks (as a prefix such as /24). ip route show lists the routes, and the line beginning default via holds the default gateway.
Exercise
ipconfig shows IPv4 Address 169.254.17.9, subnet mask 255.255.0.0, and no default gateway. What most likely happened, and what do you try first?
Show answer
The address is an APIPA address, so the computer asked for a DHCP lease and received no reply. Check the physical link or Wi-Fi connection and whether the DHCP server (usually the router) is working, then run ipconfig /renew to request a new lease.
Exercise
A computer has address 192.168.1.42, mask 255.255.255.0, and default gateway 192.168.2.1. Why will it fail to reach other networks?
Show answer
The gateway 192.168.2.1 is outside the local subnet 192.168.1.0/24, so the computer cannot send packets to it directly. Traffic for other networks never reaches a router. The gateway setting must be corrected, or the address and mask must be changed.