Skip to content
Snell Rojas

Programming

How to Delete an IP Route in Ubuntu

How to delete a route from the routing table in Ubuntu and other Linux distributions with ip route del, and how to check it's gone.

Snell RojasPublished Updated 1 min read

I wrote this post in Spanish in 2022 and adapted it to English in 2026.

I have some routes in my routing table, but I want to delete one of them. How can I do that?

List the Existing Routes #

To get the details of the route we're going to delete, we list the existing routes on our system.

bash
$ sudo ip route show

default via 192.168.122.1 dev ens3
10.0.3.0/24 dev lxcbr0  proto kernel  scope link  src 10.0.3.1
172.16.0.0/24 via 192.168.122.1 dev ens3
192.168.122.0/24 dev ens3  proto kernel  scope link  src 192.168.122.211

Delete a Specific Route #

This command works on all modern Linux distributions, like Kali, Debian, Ubuntu, Fedora and CentOS. We delete the route by giving its specific details, like this.

We'll use the ip route del command and pass the related parameters.

bash
$ sudo ip route del 172.16.0.0/24 via 192.168.122.1 dev ens3
  • ip route del is the delete command.
  • 172.16.0.0/24 via 192.168.122.1 dev ens3 is the route we want to delete. We give the full route details so there's no room for mistakes.

Check That the Route Was Deleted #

Now we want to check the current state of our routing table. We run the same command we ran at the start.

bash
$ sudo ip route show

default via 192.168.122.1 dev ens3
10.0.3.0/24 dev lxcbr0  proto kernel  scope link  src 10.0.3.1
192.168.122.0/24 dev ens3  proto kernel  scope link  src 192.168.122.211

As you can see in the output, the route to 172.16.0.0/24 is gone from the routing table.