Bug 6548 - "route del" can't delete default routes
Summary: "route del" can't delete default routes
Status: RESOLVED INVALID
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.19.x
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-14 14:55 UTC by uros7272
Modified: 2013-10-23 06:29 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description uros7272 2013-10-14 14:55:53 UTC
At the boot, dhcp client sets following routing table:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.2.6.1        0.0.0.0         UG    0      0        0 eth0
10.1.1.111      10.2.6.1        255.255.255.255 UGH   0      0        0 eth0
10.1.1.112      10.2.6.1        255.255.255.255 UGH   0      0        0 eth0
10.2.6.0        0.0.0.0         255.255.254.0   U     0      0        0 eth0
10.2.6.1        0.0.0.0         255.255.255.255 UH    0      0        0 eth0

Trying to delete default route with:

$ route del default gw 10.2.6.1 eth0

didn't succeed, the table still reads:

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.2.6.1        0.0.0.0         UG    0      0        0 eth0
10.1.1.111      10.2.6.1        255.255.255.255 UGH   0      0        0 eth0
10.1.1.112      10.2.6.1        255.255.255.255 UGH   0      0        0 eth0
10.2.6.0        0.0.0.0         255.255.254.0   U     0      0        0 eth0
10.2.6.1        0.0.0.0         255.255.255.255 UH    0      0        0 eth0

On a related note, similar route also can't be removed

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 eth1
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1

$ route del default eth1

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 eth1
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1

(I have checked on Fedora 19 that its default routes can be removed without problems using above commands.)
Comment 1 uros7272 2013-10-23 06:29:38 UTC
This turned out to be ConnectionManager "feature" to automatically add back default gateway, even when user wants to remove it.