Deleting a route with ip route del removes a destination path from the running routing table immediately. This is useful when a temporary lab route is no longer needed, when a wrong static prefix was added, or when traffic must stop using a specific next hop without waiting for an interface restart.
The ip route delete form uses the same route description style as ip route add. The destination prefix and table identify the route, and any extra attributes supplied in the delete command such as via, dev, or metric must still match the installed entry or the kernel refuses to remove it.
Removing the wrong route can cut off access to a subnet or even to the default gateway, especially on a remote host. Inspect the installed route first, copy its identifying fields into the delete command, and remember that runtime changes do not remove the same route from the persistent network configuration.
Steps to delete a route with ip route:
- Show the current route entry so the delete command can match the installed prefix, gateway, device, and table exactly.
$ ip route show table 100 default via 192.0.2.254 dev lab0 onlink 198.51.100.0/24 via 192.0.2.1 dev lab0 metric 50
When more than one route exists for the same prefix, include enough fields to identify only the intended entry.
- Delete the route from the running table with the same identifying fields.
$ sudo ip route delete 198.51.100.0/24 via 192.0.2.1 dev lab0 metric 50 table 100
- Verify that the prefix no longer appears in that table.
$ ip route show table 100 default via 192.0.2.254 dev lab0 onlink
- Remove the same route from the host's persistent network configuration if it should stay deleted after interface restart or reboot.
Runtime route deletion only changes the current kernel routing table. NetworkManager, systemd-networkd, netplan, or legacy interface scripts can recreate the route later if the saved config is left unchanged.
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.
