Manage and display the kernel routing table.
high risk
ip route show > /root/routes.backupSave the routing table.ip route get <dest>See which route is used.ip route manages the kernel IP routing table. Used for adding static routes, debugging routing decisions, and configuring policy-based routing. Changes are temporary (lost on reboot) unless written to network config files.
ip route showDisplay the full routing table · explain & risk-check →ip route get 8.8.8.8Show which route/interface reaches a destination · explain & risk-check →ip route add 10.10.0.0/16 via 192.168.1.1Add static route · explain & risk-check →ip route del 10.10.0.0/16Remove a static route · explain & risk-check →ip route add default via 192.168.1.1Set default gateway · explain & risk-check →Use `ip route get <dest>` to instantly verify which gateway will be used for any destination — the most reliable way to debug routing issues without reading the full routing table.
Reference text is hand-written and may be incomplete — check man ip for your version. Test destructive commands on a non-production system first.