Bug 2094895

Summary: duplicate default routes when configured different metrics
Product: Red Hat Enterprise Linux 9 Reporter: Mingyu Shi <mshi>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.1CC: ferferna, jiji, jishi, network-qe, sfaye, till
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nmstate-2.1.3-0.20220714.81d80992.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 10:01:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mingyu Shi 2022-06-08 14:48:18 UTC
Description of problem:
According to https://bugzilla.redhat.com/show_bug.cgi?id=1896934#c22 , since nmstat-1.0.2, nmstate will apply only one route when different metrics exist, this  rule is broken in the current rust version.

Version-Release number of selected component (if applicable):
nmstate-2.1.1-0.alpha.20220602.5accbd1.el9.x86_64
NetworkManager-1.39.5-1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
echo "
interfaces:
- name: dummy0
  type: dummy
  state: up
  ipv4:
    address:
    - ip: 192.0.2.251
      prefix-length: 24
    enabled: true
  ipv6:
    address:
    - ip: 192::251
      prefix-length: 64
    enabled: true
routes:
  config:
  - destination: 0.0.0.0/0
    next-hop-address: 192.0.2.1
    next-hop-interface: dummy0
    metric: 300
  - destination: 0.0.0.0/0
    next-hop-address: 192.0.2.1
    next-hop-interface: dummy0
    metric: 301
  - destination: 0.0.0.0/0
    next-hop-address: 192.0.2.2
    next-hop-interface: dummy0
    metric: 302
  - destination: 0.0.0.0/0
    next-hop-address: 192.0.2.1
    next-hop-interface: dummy0
  - destination: ::/0
    next-hop-address: 192::1
    next-hop-interface: dummy0
    metric: 300
  - destination: ::/0
    next-hop-address: 192::1
    next-hop-interface: dummy0
    metric: 301
  - destination: ::/0
    next-hop-address: 192::2
    next-hop-interface: dummy0
    metric: 302
  - destination: ::/0
    next-hop-address: 192::1
    next-hop-interface: dummy0
" | nmstatectl apply
ip route
ip -6 route

Actual results:
There are 4 default routes via dummy0 with different metrics in every route table.

Expected results:
Only one default route via dummy0 exists

Additional info:

Comment 1 Gris Ge 2022-07-04 09:37:57 UTC
Patch posted to upstream: https://github.com/nmstate/nmstate/pull/1957


Nmstate will ignore metric difference as nmstate-1.x branch.

Comment 7 Gris Ge 2022-07-27 07:56:02 UTC
*** Bug 2044766 has been marked as a duplicate of this bug. ***

Comment 9 errata-xmlrpc 2022-11-15 10:01:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7991