Gateway Outside Subnet

Beginner Troubleshoot

Question

A workstation is configured with IP address 192.168.10.50 and prefix length /28. The default gateway is set to 192.168.10.1. The workstation has no internet access and cannot ping the gateway. Identify the problem.

Given

{
  "device_ip": "192.168.10.50/28",
  "gateway": "192.168.10.1"
}

Answer

{
  "device_network": "192.168.10.48/28",
  "device_range": "192.168.10.49 - 192.168.10.62",
  "device_broadcast": "192.168.10.63",
  "gateway_network": "192.168.10.0/28",
  "gateway_in_device_subnet": false,
  "problem": "The gateway 192.168.10.1 is in subnet 192.168.10.0/28, but the device is in 192.168.10.48/28. They are in different /28 subnets.",
  "fix_option_a": "Change device IP to 192.168.10.1-compatible range, e.g. 192.168.10.5/28",
  "fix_option_b": "Change gateway to an IP in the device's subnet, e.g. 192.168.10.49/28"
}

Try to solve it first, then click Reveal Answer

Step-by-Step Explanation

Step 1: Find which /28 block the device belongs to

192.168.10.50 with /28 mask:

/28 boundaries in the 10.x range occur at multiples of 16: 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240

50 falls between 48 and 64, so the device is in the 192.168.10.48/28 block: - Network: 192.168.10.48 - Usable: 192.168.10.49 – 192.168.10.62 - Broadcast: 192.168.10.63 - Mask: 255.255.255.240

Step 2: Find which /28 block the gateway belongs to

Gateway IP: 192.168.10.1

1 falls between 0 and 16, so the gateway is in the 192.168.10.0/28 block: - Network: 192.168.10.0 - Usable: 192.168.10.1 – 192.168.10.14 - Broadcast: 192.168.10.15

Step 3: Confirm they are in different subnets

Device Gateway
IP 192.168.10.50 192.168.10.1
Subnet 192.168.10.48/28 192.168.10.0/28
Same subnet? NO —

The device's subnet is .48/28, the gateway's subnet is .0/28. The device cannot ARP for the gateway because ARP only works within the same subnet. Result: Gateway unreachable, no internet access.

Step 4: Fix options

Option A — Move the device to the same /28 as the gateway:

New device IP: 192.168.10.5/28
Gateway: 192.168.10.1/28 (same subnet ✓)

Option B — Move the gateway to the same /28 as the device:

Device IP: 192.168.10.50/28 (unchanged)
New gateway: 192.168.10.49/28 (first usable in .48/28 block)

Step 5: Verify

After applying the fix, verify on the device:

# Check IP and mask
ip addr show
# Expected: 192.168.10.5/28

# Verify gateway is reachable (same subnet)
ping 192.168.10.1

# Test internet
ping 8.8.8.8

Key lesson

A gateway IP must be in the same subnet as the device it serves. The gateway is the device's on-ramp to the rest of the network — if it's not reachable via ARP (on-link), the device is isolated.

Related Terms

More Troubleshoot Worksheets