Textbook language

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)

  1. Physics and L2: whether links are lit on the network card and port, whether the interface is up, whether it sees arp -a local neighbors and gateway?
  2. IP configuration (ipconfig /all): has the PC received an APIPA auto-configuration address 169.254.x.x instead of DHCP? Are the mask and default gateway correct?
  3. OS stack and local segment: does it respond to ping 127.0.0.1 (loopback), and then ping ⟨gateway⟩?
  4. External IP and trace: is it going ping 203.0.113.10 (without DNS) and where does it break or loop tracert -d?
  5. Name resolution and sockets: does it respond to nslookup and 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 sizes L, by the increase in latency ΔRTT they estimate the channel: C ≈ 2 · ΔL / ΔRTT with 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...; -d disables 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 (where 0.0.0.0 — default route) and adding a static route.
  • netstat -ano (also -e Ethernet statistics, -s by protocol) — active connections and open ports with process PID.
  • netsh Wi-Fi 6 net: IP configuration (netsh interface ipv4 set address...), shared folders (net share, net use, net view).

Comparison of Windows and Linux diagnostic commands

TaskWindows (CMD / PowerShell)Linux
Interface configuration, IP, MACipconfig /allip addr (or ip a)
Routing tableroute printip route
ARP table (neighbors)arp -aip neigh
Open ports and sockets + PIDnetstat -anoss -tulnp (listening) / ss -tunap
ICMP check / traceping / tracert -dping -c 4 / traceroute -n (tracepath)
DNS query / TCP port testnslookup / Test-NetConnection -Port 443dig (getent hosts) / nc -zv
HTTP/TLS (L7) check and DNS cacheInvoke-WebRequest / ipconfig /flushdnscurl -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.