Removing a stale static route stops traffic for a specific network from being forced through an outdated gateway or interface. That is often the fix when a subnet has moved, a VPN path is no longer needed, or a temporary route override is now sending packets away from the path Linux should normally choose.
Linux keeps active routes in kernel routing tables, and ip route from iproute2 adds, lists, and deletes those entries immediately. The safest removal flow is to display the exact route first, note any selectors such as via, dev, metric, or table, and then pass the matching values to ip route del so only the intended entry is removed.
Deleting the live route requires root or sudo privileges and changes forwarding as soon as the command succeeds. If the same route was defined in NetworkManager, netplan, systemd-networkd, or another persistent network configuration, it can return on the next interface reload or reboot unless that source is updated too.
Related: How to add a static route in Linux
Related: How to check the default route in Linux
Related: How to show routes in Linux
Steps to remove a static route in Linux:
- Display the route entry that should be removed and note the full line Linux currently uses for that destination.
$ ip route show 203.0.113.0/24 203.0.113.0/24 via 192.0.2.1 dev dummy0
The destination prefix is the key, and optional selectors such as via, dev, metric, or table help target the exact route when more than one similar entry exists.
- Delete the static route by passing the destination prefix and the selectors that identify that exact entry.
$ sudo ip route del 203.0.113.0/24 via 192.0.2.1 dev dummy0
Route removal takes effect immediately, so hosts that relied on that path can become unreachable until another valid route exists. If the route lives outside the main table, add table <table> to both the display and delete commands.
- Confirm that the removed prefix no longer appears in the active routing table.
$ ip route show 203.0.113.0/24
No output means the route is no longer present in the current routing table.
- Query the kernel for a real destination inside that network to confirm which path Linux now prefers.
$ ip route get 203.0.113.50 203.0.113.50 via 172.17.0.1 dev eth0 src 172.17.0.3 uid 0 cacheThis lookup shows the route Linux would actually use now. After removing a more specific static route, traffic often falls back to the default gateway or another remaining matching route.
- Remove the same route from the persistent network configuration if it returns after the interface is reloaded or the host reboots.
Update the source that created the route, such as a NetworkManager profile, a netplan file, a systemd-networkd unit, or a legacy distro network script, before cycling the connection.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
