Bug 2212741 - network system role deletes gateway information
Summary: network system role deletes gateway information
Keywords:
Status: ON_QA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: nmstate
Version: 9.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: 9.3
Assignee: Gris Ge
QA Contact: Mingyu Shi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-06 08:15 UTC by Marko Myllynen
Modified: 2023-08-14 07:56 UTC (History)
11 users (show)

Fixed In Version: nmstate-2.2.14-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github nmstate nmstate pull 2387 0 None open nm: Preserve gateway when not desired 2023-07-17 06:52:05 UTC
Red Hat Issue Tracker NMT-599 0 None None None 2023-06-06 18:55:08 UTC
Red Hat Issue Tracker RHELPLAN-159070 0 None None None 2023-06-06 13:55:13 UTC

Description Marko Myllynen 2023-06-06 08:15:39 UTC
Description of problem:
I have two freshly installed test VMs, all defaults Server Minimal install of RHEL 8.8 and RHEL 9.2, then all updates applied and VMs rebooted.

This is their network configuration:

# grep -v ^# /etc/NetworkManager/NetworkManager.conf | grep -v ^$
[main]
plugins=keyfile
[logging]
# cat /etc/NetworkManager/system-connections/enp1s0.nmconnection
[connection]
id=enp1s0
uuid=ea4d1672-de2e-3b87-a234-5f861e452d77
type=ethernet
interface-name=enp1s0

[ethernet]

[ipv4]
address1=192.168.122.221/24,192.168.122.1
dns=192.168.1.1;
dns-options=edns0;no-aaaa;trust-ad;
dns-search=example.com;
method=manual

[ipv6]
method=disabled

[proxy]

Running a playbook on a RHEL 9 control host with:

  vars:
    network_state:
      dns-resolver:
        config:
          server:
            - 192.168.1.1
            - 127.0.0.1
          search:
            - example.com
            - domain.name
  roles:
    - redhat.rhel_system_roles.network

I see that configuration was changed for both managed VMs and on RHEL 8 the result looks like this:

[ipv4]
address1=192.168.122.170/24
dhcp-client-id=mac
dns=192.168.1.1;127.0.0.1;
dns-options=edns0;no-aaaa;trust-ad;
dns-priority=40
dns-search=example.com;domain.name;
method=manual
route1=0.0.0.0/0,192.168.122.1,100
route1_options=table=254

However on RHEL 9 the result is:

[ipv4]
address1=192.168.122.221/24
dns=192.168.1.1;127.0.0.1;
dns-options=edns0;no-aaaa;trust-ad;
dns-priority=40
dns-search=example.com;domain.name;
method=manual

Version-Release number of selected component (if applicable):
ansible-core-2.14.2-4.el9.x86_64
rhel-system-roles-1.21.1-1.el9_2.noarch

Comment 1 Wen Liang 2023-06-06 18:50:10 UTC
Thanks for reporting this, this is a valid report, I already reproduced it in RHEL 9.2 (lost the gateway information), since the `network_state` was using the nmstate as the backend, I'd like to change the component into nmstate.

Comment 4 Gris Ge 2023-07-11 13:28:34 UTC
The root cause is previous state is not generated by nmstate and using old setting method on gateway:

```
address1=192.168.122.221/24,192.168.122.1
```

we are expecting gateway been set as

```
route1=0.0.0.0/0,192.168.122.1,100
```

Anyway, you will get a fix soon.

Comment 5 Gris Ge 2023-07-17 06:52:05 UTC
Patch sent to upstream: https://github.com/nmstate/nmstate/pull/2387

If you need fix been backported to RHEL 9.2, please let me know.


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