Someone added a route for all of 192.168.0.0/16 through the office router. The stockroom's 192.168.50.0/24 is inside it, so for the scanner, two routes match.
The most specific route wins: the one with the longest prefix. A /24 beats a /16, and anything beats default, which is a /0.
New command
ip route get
Asks the routing table which route an address would take, without sending anything.
Usageip route get address
text
learner@ops:~$ ip route get 10.0.0.10
10.0.0.10 dev eth0 src 10.0.0.5 uid 1000 ← no via: straight out of eth0
cacheuid is who asked; cache you can ignore.
Objectives
- Which interface does the scanner's route use?
- Which router does the till's route use?