The branch shop's network is 10.1.0.0/24, and its till is 10.1.0.7. Its router, branch-gw, is on the office network too, at 10.0.0.254: that's the way in.
Someone added a route for it already, but a wrong one: 10.1.0.0/16 via 10.0.0.1, the office router, which doesn't know the branch. The till doesn't answer.
sudo ip route add
Adds a route to a network through a router. The router must be on a network the machine is on, or it's refused: Error: Nexthop has invalid gateway.
sudo ip route add 10.1.0.0/24 via 10.0.0.254The /24 is more specific than the /16, so it wins for the till straight away. The /16 is still wrong, so take it out, network and prefix exactly as ip route shows them:
sudo ip route del 10.1.0.0/16Like addresses, routes added this way last until the interface goes down or the machine restarts. Ubuntu keeps permanent ones in its netplan configuration.
Objectives
- Reach the till.
- Delete the wrong route.