Network diagnostics in Windows and Linux
In case of a network failure, do not guess randomly — go through the stack from bottom to top and record the exact stage where behavior deviates from the norm. Choose a failure scenario and run commands: the packet on the diagram will immediately show exactly where it stopped or looped!
Bottom-up diagnostic algorithm (L1 → L2 → L3 → DNS → L4)
- Physics and L2: whether links are lit on the network card and port, whether the interface is up, whether it sees
arp -alocal neighbors and gateway? - IP configuration (
ipconfig /all): has the PC received an APIPA auto-configuration address169.254.x.xinstead of DHCP? Are the mask and default gateway correct? - OS stack and local segment: does it respond to
ping 127.0.0.1(loopback), and thenping ⟨gateway⟩? - External IP and trace: is it going
ping 203.0.113.10(without DNS) and where does it break or looptracert -d? - Name resolution and sockets: does it respond to
nslookupand is the application listening on the port (netstat -ano/Test-NetConnection)?
Windows network utilities and ping measurements
hostname— computer name on the network.ipconfig /all— full configuration: MAC, DHCP on/off, lease time, IPv4, mask, gateway, DNS. Switches:/release(release lease),/renew(renew lease),/flushdns(clear DNS cache).ping— ICMP Echo reachability check. Switches:-t(until Ctrl+C),-n 10(number of packets),-l 1400(buffer size),-i 64(TTL),-f(prohibit fragmentation). Estimation in a simplified model: by taking measurements with different packet sizesL, by the increase in latencyΔRTTthey estimate the channel:C ≈ 2 · ΔL / ΔRTTwith equal speed in both directions and other latencies unchanged. This is a model, not a measurement of the actual route's throughput: RTT depends on queues, ICMP priority, routes, and processing at nodes.tracert -d -h 30— node tracing (shows triggers ICMP Time Exceeded at TTL=1,2,3...;-ddisables slow reverse DNS). If two addresses alternate (10.7.11.11 ↔ 10.7.10.11) — this is a routing loop!nslookup— A/AAAA/MX record query to a DNS server.arp -a / -s / -d— viewing, statically adding, and deleting IP ↔ MAC mappings.route print/route add— viewing the routing table (where0.0.0.0— default route) and adding a static route.netstat -ano(also-eEthernet statistics,-sby protocol) — active connections and open ports with process PID.netshWi-Fi 6net: IP configuration (netsh interface ipv4 set address...), shared folders (net share,net use,net view).
Comparison of Windows and Linux diagnostic commands
| Task | Windows (CMD / PowerShell) | Linux |
|---|---|---|
| Interface configuration, IP, MAC | ipconfig /all | ip addr (or ip a) |
| Routing table | route print | ip route |
| ARP table (neighbors) | arp -a | ip neigh |
| Open ports and sockets + PID | netstat -ano | ss -tulnp (listening) / ss -tunap |
| ICMP check / trace | ping / tracert -d | ping -c 4 / traceroute -n (tracepath) |
| DNS query / TCP port test | nslookup / Test-NetConnection -Port 443 | dig (getent hosts) / nc -zv |
| HTTP/TLS (L7) check and DNS cache | Invoke-WebRequest / ipconfig /flushdns | curl -I https://... / resolvectl status |
Verification order: find the active interface and its prefix, check the route to the destination address, then the MAC of the next hop. If the request reached, check the return route and filtering rules. For addresses in the same subnet, a separate gateway is usually not needed.