RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1785039 - nmcli command to add ipv4.gateway does not work when DEFROUTE=no and throws no error
Summary: nmcli command to add ipv4.gateway does not work when DEFROUTE=no and throws n...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.5
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Thomas Haller
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks: 1797742
TreeView+ depends on / blocked
 
Reported: 2019-12-18 23:19 UTC by Richard Hyman
Modified: 2023-12-15 17:06 UTC (History)
10 users (show)

Fixed In Version: NetworkManager-1.18.6-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-29 20:30:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:4003 0 None None None 2020-09-29 20:30:52 UTC

Description Richard Hyman 2019-12-18 23:19:08 UTC
Description of problem:

nmcli command to add ipv4.gateway does not work when DEFROUTE=no and throws no error

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

RHEL 7.5
3.10.0-862.14.4.el7.x86_64
NetworkManager-1.10.2-16.el7_5.x86_64                       

How reproducible:

very

Steps to Reproduce:
1. create an interface (ifcfg file manually or with nmcli)
2. nmcli connection modify vlan1006 ipv4.never-default yes
3. nmcli con mod vlan1006 ipv4.gateway 192.168.100.1 


Actual results:

No output error is shown and ipv4 gateway is not added. Troubleshooting showed you had to change never-default to "no" for the gateway to be added.

Expected results:

Customer would expect this to throw an error. Not sure if this is a bug or RFE. I am explaining to customer that likely this is because of how default routes used to work with /etc/sysconfig/gateway and setting gateway with DEFROUTE=yes however this is deprecated so it does make sense this should throw an error. 

Additional info:

Comment 6 Thomas Haller 2020-04-08 14:13:18 UTC
dropping from RPL-8.3, it's already on the RPL-7.9.

Comment 7 Thomas Haller 2020-04-22 12:40:53 UTC
upstream fix on review: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/475

Comment 9 Thomas Haller 2020-04-22 20:38:50 UTC
now nmcli is changed.

when you set ipv4.gateway (ipv6.gateway) on the command line, then it also will set ipvx.never-default to no.

that means,

  nmcli connection modify "$PROFILE" ipv4.never-default yes ipv4.gateway 192.168.1.1

results in never-default "no"... because the latter setting of gateway wins. At first that might seem odd, but in general, if you specify an option (or overlapping options like in this case) multiple times, then the last one wins. That is now fixed.

Comment 14 errata-xmlrpc 2020-09-29 20:30:25 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 (Moderate: NetworkManager security and bug fix 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/RHSA-2020:4003


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