Bug 1655638 - ip -6 route replace adds route instead of replacing it
Summary: ip -6 route replace adds route instead of replacing it
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: iproute
Version: 7.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Andrea Claudi
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-03 15:33 UTC by Phil
Modified: 2019-12-05 15:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-05 15:57:24 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Phil 2018-12-03 15:33:49 UTC
Description of problem:

ip -6 route replace default via … should replace the ipv6 default route. Instead, it adds the new default route to the table.

Version-Release number of selected component (if applicable):
kernel 3.10.0-957.el7.x86_64
iproute 4.11.0-14.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. ip -6 route ls default
default via $mydefgw_A dev eth0 metric 1 pref medium
2. ip -6 route replace default via $mydefgw_B
3. ip -6 route ls default
default via $mydefgw_A dev eth0 metric 1 pref medium
default via $mydefgw_B dev eth1 metric 1024 pref medium

Actual results:
two default routes

Expected results:
one default route

Additional info:

Comment 2 Andrea Claudi 2019-06-06 13:16:51 UTC
Since this issue is not critical, I'm moving it to RHEL-7.8.

Comment 3 Andrea Claudi 2019-12-05 15:57:24 UTC
(In reply to Phil from comment #0)
> Description of problem:
> 
> ip -6 route replace default via … should replace the ipv6 default route.
> Instead, it adds the new default route to the table.
> 
> Version-Release number of selected component (if applicable):
> kernel 3.10.0-957.el7.x86_64
> iproute 4.11.0-14.el7.x86_64
> 
> How reproducible:
> always
> 
> Steps to Reproduce:
> 1. ip -6 route ls default
> default via $mydefgw_A dev eth0 metric 1 pref medium
> 2. ip -6 route replace default via $mydefgw_B

With the above command you are effectively requesting to add a new different default route via $mydefgw_B, not to replace the previous one (I know, replace command is a bit misleading).
To replace the default route you must make sure to select it indicating additional params you may have specified during its creation. In your case:

ip -6 route replace default via $mydefgw_B metric 1 pref medium

> 3. ip -6 route ls default
> default via $mydefgw_A dev eth0 metric 1 pref medium
> default via $mydefgw_B dev eth1 metric 1024 pref medium
> 
> Actual results:
> two default routes
> 
> Expected results:
> one default route
> 
> Additional info:


Note You need to log in before you can comment on or make changes to this bug.