Bug 1962551

Summary: Cannot remove route from different table than default
Product: Red Hat Enterprise Linux 8 Reporter: Ales Musil <amusil>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: high Docs Contact:
Priority: high    
Version: 8.4CC: ferferna, jiji, jishi, mburman, mperina, network-qe, till
Target Milestone: betaKeywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1964440 (view as bug list) Environment:
Last Closed: 2021-11-09 17:43:51 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:
Bug Depends On:    
Bug Blocks: 1962563, 1964440    
Attachments:
Description Flags
Reproducer none

Description Ales Musil 2021-05-20 09:20:33 UTC
Created attachment 1785085 [details]
Reproducer

Description of problem:
Cannot remove route that is not in default route table.

Version-Release number of selected component (if applicable):
nmstate-1.0.2-6.el8.noarch
nispor-1.0.1-4.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Run the reproducer

Actual results:
The route in table 5000 is still present

Expected results:
The route should be gone

Comment 1 Mingyu Shi 2021-05-24 07:39:59 UTC
I have a similar test but it works well... After comparing and investigating, I find if you add a ipv6 route in the beginning, it will work. The only difference is to replace `dummy0.yaml` with:

cat << EOF > dummy0.yaml
---
interfaces:
  - name: dummy0
    type: dummy
    state: up
    ipv4:
      address:
        - ip: 192.0.1.100
          prefix-length: 24
      dhcp: false
      enabled: true
    ipv6:
      enabled: true
      address:
        - ip: 1000::1010
          prefix-length: 64
routes:
  config:
    - destination: 192.0.1.0/24
      metric: 150
      next-hop-address: 192.0.1.100
      next-hop-interface: dummy0
      table-id: 5000
    - destination: ::/0
      metric: -1
      next-hop-address: 1000::1
      next-hop-interface: dummy0
      table-id: 200
EOF

Comment 2 Gris Ge 2021-05-24 08:08:49 UTC
This looks like a NetworkManager bug to me. The `Reapply` of NetworkManager does not remove old route entries.

The workaround is possible in nmstate by using normal activation when route changes. Bridge or bond port cannot hold route entries, so this should not impact existing user needing `Reapply`.

Will collect logs and report new bugs to NetworkManager and then we decide whether we choose workaround in nmstate or fix in NetworkManager or even both.

Comment 3 Gris Ge 2021-05-25 13:21:42 UTC
Bug reported to https://bugzilla.redhat.com/show_bug.cgi?id=1964336 to NetworkManager with low priority as nmstate workaround is easy.


Nmstate patch posted to upstream: https://github.com/nmstate/nmstate/pull/1602

Comment 7 Mingyu Shi 2021-05-27 09:01:55 UTC
Pretested with versions:
nmstate-1.1.0-0.20210526235438600256.pr1602.45.g738d25a.el8.noarch
nispor-1.1.0-4.el8.x86_64
NetworkManager-1.32.0-0.3.el8.x86_64
DISTRO=RHEL-8.5.0-20210524.d.0
Linux dell-per740-80.rhts.eng.pek2.redhat.com 4.18.0-305.7.el8.kpq1.x86_64 #1 SMP Mon May 17 13:36:02 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux

Simply run the reproducer, and when the route was removed, the corresponding NM profile was deactivated(the old behavior is only one: 'changed')
dummy0: connection profile changed
dummy0: deactivating
dummy0: disconnected
dummy0: device removed
dummy0: device created
dummy0: unavailable
dummy0: disconnected
dummy0: using connection 'dummy0'
dummy0: connecting (prepare)
dummy0: connecting (configuring)
dummy0: connecting (getting IP configuration)
dummy0: connecting (checking IP connectivity)
dummy0: connecting (starting secondary connections)
dummy0: connected

Comment 10 Mingyu Shi 2021-06-18 02:35:42 UTC
Verified with versions:
nmstate-1.1.0-0.3.alpha3.el8.noarch
nispor-1.1.0-2.el8.x86_64
NetworkManager-1.32.0-0.5.el8.x86_64

The result is same with #comment7

Comment 12 errata-xmlrpc 2021-11-09 17:43:51 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-2021:4157