Reach some hosts and not others — the mask fault

short · 45 min · Objective 5.3

Task

Reproduce the most instructive addressing fault there is: a wrong subnet mask, whose signature is reaching some destinations and not others with no obvious pattern. Seeing why it happens — the mask deciding what the host treats as local — fixes the symptom-to-cause pairing the exam tests.

Steps

  1. Baseline: with the correct /24 mask, confirm Host A reaches both 192.168.10.10's neighbours — say 192.168.10.20 and 192.168.10.200 — and the gateway. Everything local works.
  2. Inject the fault: set Host A's mask to /26 instead of /24 (sudo ip addr flush dev eth0; sudo ip addr add 192.168.10.10/26 dev eth0). Its network is now 192.168.10.0/26, so it believes only .1–.63 are local.
  3. Observe the split. Ping 192.168.10.20 — inside /26, still works. Ping 192.168.10.200 — outside /26, now fails, because Host A treats it as remote and sends it to the gateway, which cannot help on the same wire. Some hosts reachable, some not, no obvious pattern: that is the fault.
  4. Confirm the mechanism. ip route show now lists 192.168.10.0/26 as the local route; the .200 address matches no local route and is punted to the default gateway. The mask, not a cable, decided reachability.
  5. Fix it: restore /24 and confirm .200 is reachable again.

Verify

ip -br addr show eth0
ping -c 2 -W 2 192.168.10.20; echo "in-mask host exit $?"
ping -c 2 -W 2 192.168.10.200; echo "out-of-mask host exit $?"

With the wrong /26 mask, the two pings disagree — one succeeds, one fails, to addresses on the same physical wire. That disagreement is the fingerprint of a mask fault. After restoring /24, both succeed, and ip -br addr showing the /24 is the confirmation the fix is in place.

Notes

The rule to carry into the exam: "can ping some hosts on the same LAN but not others" means check the mask before anything else. It is the mask's job to decide which destinations are local, so the host runs a bitwise AND, gets the wrong network for the excluded addresses, ARPs for hosts it should have routed or routes hosts it should have ARPed — and the result is the patternless split you just produced.

Contrast the neighbouring faults so you do not confuse them. An incorrect gateway reaches everything local and nothing remote — a clean split at the subnet boundary, not a patchy one within the subnet. A duplicate IP gives intermittent connectivity for both holders. Each addressing fault has its own signature, and the mask's is the patchy one.