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 →
- Run
ip routeand confirm there is adefault via <gw>line - Run
ip route get 8.8.8.8to see the chosen gateway and interface - Ping the gateway itself with
ping -c2 <gw>and checkip neighfor a REACHABLE entry - In cloud, check the subnet route table has
0.0.0.0/0to 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.
More on Addressing, CIDR & Routing
You own 10.0.0.0/16 for a new VPC and need separate /24 subnets for dev, QA and prod across two AZs. How do you carve it up?BeginnerA host is configured as 192.168.1.130/25. What network does it belong to and what is the broadcast address?BeginnerHow many usable IPs does an AWS subnet of /28 have?BeginnerA route table has 10.0.0.0/16 -> local and 10.0.1.0/24 -> vpn-gw. Where does a packet to 10.0.1.5 go?BeginnerYou are picking a private range for a new company network. Which RFC 1918 range do you choose and why?BeginnerA server has two NICs and traffic to 10.20.0.0/16 is leaving through the wrong one. How do you see and fix the route?Beginner