Score:0

SIOCDELRT: No such process when deleting default route from secondary interface on Ubuntu

ai flag

I'm trying to remove the automatically-generated default route for a particular interface on an Ubuntu machine.

I have two interfaces, enp0s3 and enp0s8. Default routes are generated for each of them:

  Destination   Gateway         Genmask      Flags     Metric    Iface  
  0.0.0.0       10.0.2.2        0.0.0.0      UG        100       enp0s3
  0.0.0.0       192.168.137.1   0.0.0.0      UG        20101     enp0s8

I want all traffic other than a specific subnet to route to the 10.0.2.2 gateway and only one particular subnet (say, 10.1.2.0/24, for example) to the 192.168.137.1 gateway.

However, when I try to remove the default route on the enp0s8 interface, I get the following:

# route del 0.0.0.0 dev enp0s8
SIOCDELRT: No such process

How do I get rid of the default route for this secondary interface and replace it with a route to only the particular subnet that I want to route to that interface?

Note: There is also a route for 192.168.137.0/24 to the enp0s8 interface. I'm not trying to remove that one, just the default one.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.