Bug 2141985

Summary: It's not possible to modify metrics on DHCP routes
Product: Red Hat Enterprise Linux 8 Reporter: Quique Llorente <ellorent>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: ferferna, jiji, jishi, network-qe, till
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 08:26:38 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 Quique Llorente 2022-11-11 10:51:15 UTC
Description of problem:
When multiple routes are received over DHCP sometimes is necessary to adjust the metrics to change routes priority

In the case of OVNKubernetes HCO is selecing the wrong primary interface to create the br-ex ovs-bridge on top of it, this means that the default gw with biggest priority will be "br-ex" interface with wrong port.

To fix that the "metric" for the expected primary interface default gw can be increased so traffic goes over there.

Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1. Change metrics at the DHCP route
routes:
      config:
      - destination: 0.0.0.0/0
        metric: 35
        next-hop-address: 10.46.41.254 
        next-hop-interface: eno1
        table-id: 253

Actual results:
Error with "next hop to interface with dynamic IP"


Expected results:
The metrics are changed

Additional info:

Comment 2 Gris Ge 2022-11-17 09:47:49 UTC
Patch posted to usptream: https://github.com/nmstate/nmstate/pull/2096

Example yaml:

```yaml
---
interfaces:
  - name: eth1
    state: up
    ipv4:
      enabled: true
      dhcp: true
      auto-route-metric: 901
    ipv6:
      enabled: true
      dhcp: true
      autoconf: true
      auto-route-metric: 902
```

Comment 5 Mingyu Shi 2023-02-02 10:18:25 UTC
Verified with:
nmstate-1.4.1-1.el8.x86_64
nispor-1.2.9-1.el8.x86_64
NetworkManager-1.40.10-1.el8.x86_64

Comment 7 errata-xmlrpc 2023-05-16 08:26:38 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-2023:2772