Interview Prep/Networking/Addressing, CIDR & Routing

A newly built server can ping everything in its subnet but nothing outside. What is the first thing you check?

BeginnerScenarioAddressing, CIDR & Routing
Answer

Situation read → Same-subnet traffic is L2 and needs no gateway. Anything off-subnet needs a default route and a working gateway.

What I'd do →

  1. Run ip route and confirm there is a default via <gw> line
  2. Run ip route get 8.8.8.8 to see the chosen gateway and interface
  3. Ping the gateway itself with ping -c2 <gw> and check ip neigh for a REACHABLE entry
  4. In cloud, check the subnet route table has 0.0.0.0/0 to an IGW or NAT gateway

Why → Same-subnet works while off-subnet fails almost always means a missing or wrong default gateway or route table entry.

Interview tip → Walk the path outward: host, gateway, route table, NAT or IGW, then security controls.

All Networking questions Roadmap: Networking for DevOps

More on Addressing, CIDR & Routing