Bug 1909729

Summary: Only a default gw is supported per device
Product: Red Hat Enterprise Linux 8 Reporter: Quique Llorente <ellorent>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.3CC: ferferna, jiji, jishi, network-qe, phoracek, till
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: 8.4Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: nmstate-1.0.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1910193 (view as bug list) Environment:
Last Closed: 2021-05-18 15:18:22 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: 1910193    

Description Quique Llorente 2020-12-21 13:56:21 UTC
Description of problem:

Trying to configure a pair of default gw towards the same devices with desiredState:

routes:
  config:
  - destination: 0.0.0.0/0
    next-hop-address: 192.168.123.1
    next-hop-interface: eth1
  - destination: 0.0.0.0/0
    next-hop-address: 192.168.123.2
    next-hop-interface: eth1
    metrics: 103
interfaces:
  - name: eth1
    type: ethernet
    state: up
    ipv4:
      enabled: true
      dhcp: false
      address:
        - ip: 192.168.123.200
          prefix-length: 24

Ends with the following error:

2020-12-21 11:40:32,675 root         DEBUG    Async action: Create checkpoint started
2020-12-21 11:40:32,678 root         DEBUG    Checkpoint None created for all devices
2020-12-21 11:40:32,678 root         DEBUG    Async action: Create checkpoint finished
2020-12-21 11:40:32,679 root         DEBUG    Async action: Rollback to checkpoint /org/freedesktop/NetworkManager/Checkpoint/64 started
2020-12-21 11:40:32,680 root         DEBUG    Checkpoint /org/freedesktop/NetworkManager/Checkpoint/64 rollback executed
2020-12-21 11:40:32,681 root         DEBUG    Interface eth0 rollback succeeded
2020-12-21 11:40:32,681 root         DEBUG    Interface eth1 rollback succeeded
2020-12-21 11:40:32,681 root         DEBUG    Interface lo rollback succeeded
2020-12-21 11:40:32,681 root         DEBUG    Async action: Rollback to checkpoint /org/freedesktop/NetworkManager/Checkpoint/64 finished
Traceback (most recent call last):
  File "/bin/nmstatectl", line 11, in <module>
    load_entry_point('nmstate==0.3.6', 'console_scripts', 'nmstatectl')()
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 69, in main
    return args.func(args)
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 268, in apply
    args.save_to_disk,
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 308, in apply_state
    save_to_disk=save_to_disk,
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 71, in apply
    _apply_ifaces_state(plugins, net_state, verify_change, save_to_disk)
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 104, in _apply_ifaces_state
    plugin.apply_changes(net_state, save_to_disk)
  File "/usr/lib/python3.6/site-packages/libnmstate/nm/plugin.py", line 178, in apply_changes
    nm_applier.apply_changes(self.context, net_state, save_to_disk)
  File "/usr/lib/python3.6/site-packages/libnmstate/nm/applier.py", line 140, in apply_changes
    original_desired_iface_state,
  File "/usr/lib/python3.6/site-packages/libnmstate/nm/applier.py", line 485, in _build_connection_profile
    iface_desired_state.get(Interface.IPV4), base_profile
  File "/usr/lib/python3.6/site-packages/libnmstate/nm/ipv4.py", line 77, in create_setting
    setting_ipv4, config.get(BaseIface.ROUTES_METADATA, [])
  File "/usr/lib/python3.6/site-packages/libnmstate/nm/route.py", line 161, in add_routes
    "Only a single default gateway is supported due to a "
libnmstate.error.NmstateNotImplementedError: Only a single default gateway is supported due to a limitation of NetworkManager: https://bugzilla.redhat.com/1707396


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


How reproducible:



Steps to Reproduce:
1. Apply the desired state from the description.
2.
3.

Actual results:
Only a single default gateway is supported due to a limitation of NetworkManager: https://bugzilla.redhat.com/1707396



Expected results:
Both default gw to be created


Additional info:
NetworkManager/libnm version 1.26.
nmstate version 0.3.6-2

Comment 3 Mingyu Shi 2020-12-23 03:31:15 UTC
Tested as this bug has been fixed in https://bugzilla.redhat.com/show_bug.cgi?id=1896934

Comment 6 Mingyu Shi 2021-01-05 07:50:12 UTC
Verified with versions:
nmstate-1.0.0-1.el8.noarch
nispor-1.0.1-2.el8.x86_64
NetworkManager-1.30.0-0.5.el8.x86_64

Run kernel/networking/nmstate/libnmstate/func/route.sh: func test_default_gateways
all passed

Comment 8 errata-xmlrpc 2021-05-18 15:18:22 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:1748