Mental model
Before you SSH into a switch or router, verify the client. Nine times out of ten the problem is on the laptop: DHCP failed, DNS is unset, or the default gateway isn’t reachable. Every OS has the same information — you just type slightly different commands to get at it.
The three-column cheat sheet
| Question | Windows | macOS | Linux |
|---|---|---|---|
| My IP + mask + gateway + DNS | ipconfig /all | ifconfig + scutil --dns | ip addr + resolvectl status |
| Just the essentials | ipconfig | ifconfig en0 | grep inet | ip -br addr |
| Default gateway / route table | route print | netstat -rn | ip route |
| ARP table | arp -a | arp -an | ip neigh |
| Reachability by IP | ping 8.8.8.8 | ping 8.8.8.8 | ping 8.8.8.8 |
| Path trace | tracert 8.8.8.8 | traceroute 8.8.8.8 | traceroute 8.8.8.8 (or mtr) |
| Name → IP resolution | nslookup google.com | dig google.com | dig google.com |
| Renew DHCP lease | ipconfig /renew | (off/on network toggle) | sudo dhclient -r && sudo dhclient |
| Flush DNS cache | ipconfig /flushdns | sudo dscacheutil -flushcache | sudo resolvectl flush-caches |
Reading ipconfig /all (Windows)
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : corp.example.com
Description . . . . . . . . . . . : Intel(R) Ethernet Connection I219-V
Physical Address. . . . . . . . . : 3C-52-82-1A-4B-77
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 192.168.1.42(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Sunday, August 9, 2026 8:12:31 AM
Lease Expires . . . . . . . . . . : Monday, August 10, 2026 8:12:30 AM
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DNS Servers . . . . . . . . . . . : 192.168.1.1
8.8.8.8
Six values to check: IP, mask, gateway, DNS, DHCP server, lease timestamps.
Reading ip addr (Linux)
$ ip addr
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 3c:52:82:1a:4b:77 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.42/24 brd 192.168.1.255 scope global dynamic noprefixroute enp3s0
valid_lft 79832sec preferred_lft 79832sec
inet6 fe80::3e52:82ff:fe1a:4b77/64 scope link noprefixroute
valid_lft forever preferred_lft forever
- Interface state:
UP,LOWER_UP— cable connected + link protocol up. inet 192.168.1.42/24— v4 address and prefix length.inet6 fe80::.../64 scope link— the automatic link-local IPv6 (see ipv6-address-types).
For route + gateway:
$ ip route
default via 192.168.1.1 dev enp3s0 proto dhcp metric 100
192.168.1.0/24 dev enp3s0 proto kernel scope link src 192.168.1.42 metric 100
The default via 192.168.1.1 line is your gateway.
Reading ifconfig (macOS)
macOS still ships ifconfig. Filter for the IP:
$ ifconfig en0 | grep inet
inet 192.168.1.42 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe80::3e52:82ff:fe1a:4b77%en0 prefixlen 64 secured scopeid 0x4
netmask 0xffffff00 = 255.255.255.0 = /24. Gateway lives in netstat -rn:
$ netstat -rn | grep default
default 192.168.1.1 UGSc en0
DNS servers on macOS aren’t in ifconfig — use scutil:
$ scutil --dns | grep 'nameserver\[' | head -3
nameserver[0] : 192.168.1.1
nameserver[1] : 8.8.8.8
Systematic triage — the “bottom-up” ladder
When a user says “the internet is broken”, run the ladder — first failure = broken layer.
1. ipconfig /all ← Do I have an IP? Gateway? DNS?
2. ping 127.0.0.1 ← Is my TCP/IP stack alive? (L3-4 loopback)
3. ping <my own IP> ← Is my NIC responding? (L2 self)
4. ping <default gateway> ← Is my subnet reachable? (L2/L3 local)
5. ping 8.8.8.8 ← Does routing work? (L3 remote)
6. ping google.com ← Does DNS work? (L7 name-service)
7. tracert google.com ← Where's the hop that fails? (path)
Every step maps to an OSI layer. If ping to gateway works but ping to 8.8.8.8 doesn’t, routing is broken between your subnet and the outside. If DNS fails but ping-by-IP works, look at nslookup / dig.
The #1 mistake
Assuming APIPA 169.254.x.x means “internet is broken”. That address means DHCP silently failed — your NIC assigned itself a link-local as a fallback. The wireless is up, the cable is plugged in, but no DHCP server answered. Fix DHCP (on the router / server) — not the NIC.
Related deep-dives
- DHCP — how the address you see in
ipconfiggets assigned - DNS — how
nslookup/digturn a name into an IP - ARP — how your OS learns the MAC that goes with the gateway IP
- OSI + TCP/IP — the mental model behind the ping ladder
