Menu
Coddy logo textTech

Gateway on the Wrong Subnet

Lesson 25 of 35 in Coddy's LAN Labs course.

A default gateway must be reachable directly: it has to sit inside the host's own subnet, because the host reaches it without any routing. Pointing pc1 in 192.168.1.0/24 at a gateway of 10.0.0.1 is a contradiction, even though 10.0.0.1 is a perfectly good router address on the other side.

Both tools catch it: the ping explains the contradiction, and check reports it as an ERROR. The right gateway is the router's address in the host's network.

challenge icon

Challenge

Easy

Ping pc3 from pc1, run the check, point pc1 at the router's address in its own network (192.168.1.1), and ping again.

Expected output:

pc1 -> pc3: unreachable (gateway 10.0.0.1 is not in pc1's subnet 192.168.1.0/24)
ERROR pc1: gateway 10.0.0.1 is outside its subnet 192.168.1.0/24
Lab check: 1 problem(s) found
pc1: gateway 192.168.1.1
pc1 -> pc3: reply from 10.0.0.20 (ttl=63, via r1)

Try it yourself

Terminal

All lessons in LAN Labs

Practice on your own: Terminal playground