`ip route add 10.20.0.0/16 via 10.0.5.1` fails with `Error: Nexthop has invalid gateway.`
BeginnerTroubleshootingMTU, routing, packet loss and latency
Answer
Likely causes → The gateway isn't on any directly connected subnet of the host.
Diagnose →
ip -br addr
ip route get 10.0.5.1
Fix → Use a gateway that is in a local subnet, or add dev eth1 onlink if you know the next hop is reachable at layer 2.
Prevent → Model next hops as directly connected neighbours when planning static routes.
More on MTU, routing, packet loss and latency
SSH connects, but the session freezes as soon as you run `ls` in a big directory or `cat` a large file.IntermediateHTTPS to a site over the VPN hangs after `Client hello`, while HTTP works.Intermediate`ping: local error: message too long, mtu=1500`BeginnerPods on different nodes can ping each other, but HTTP responses larger than ~1.4 KB never arrive.Advanced`mtr` shows 30% loss at hop 6, but 0% at the final destination.Beginner`mtr` shows loss starting at hop 4 and continuing to the destination at 8–10%.Intermediate