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 1767100 - nameservers are not written correctly by the ifcfg module
Summary: nameservers are not written correctly by the ifcfg module
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dracut
Version: 8.0
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: 8.0
Assignee: Lukáš Nykrýn
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-30 16:58 UTC by Christophe Besson
Modified: 2021-05-18 15:03 UTC (History)
5 users (show)

Fixed In Version: dracut-049-129.git20210107.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 15:02:41 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github dracutdevs dracut pull 667 0 None closed Write dns values passed by ip argument to ifcfg-* files 2021-02-18 11:25:18 UTC

Description Christophe Besson 2019-10-30 16:58:45 UTC
Description of problem:
According to the code of net-lib.sh and the manual of dracut.cmdline, the ip argument from the cmdline used for early networking setup may have several forms, including this one:
ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]

The last columns are not parsed, so the DNS1 and DNS2 are not present in the generated ifcfg files (which are themselves used by the NetworkManager).

Version-Release number of selected component (if applicable):
# rpm -qf /usr/lib/dracut/modules.d/45ifcfg/write-ifcfg.sh 
dracut-network-049-10.git20190115.el8.x86_64

How reproducible:
echo "kernel_cmdline=ip=192.168.122.100::192.168.122.1:255.255.255.0::ens3:none:8.8.8.8" > /etc/dracut.conf.d/static_ip.conf
dracut -fv --regenerate-all

Actual results:
No DNS1 and DNS2 entries in /etc/sysconfig/network-scripts/ifcfg-*

Expected results:
DNS1 and DNS2 are present in the ifcfg file.

Additional info:
The code of write-ifcfg only iterates the nameserver arguments from the cmdline.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    i=1
    for ns in $(getargs nameserver); do
        echo "DNS${i}=\"${ns}\"" >> /tmp/ifcfg/ifcfg-$netif
        i=$((i+1))
    done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Comment 1 Christophe Besson 2019-10-30 17:02:14 UTC
Additionally, there is no way to define a DOMAIN with this ifcfg module. This is a second issue, since the early network setup overwrites files generated by anaconda (parse-kickstart), so there is no way to define the DOMAIN value in the ifcfg file (the NetworkManager reads that to write /etc/resolv.conf).

Comment 2 Jan Macku 2019-11-01 14:12:06 UTC
Pull-request that should fix this issue was send to upstream:

https://github.com/dracutdevs/dracut/pull/667

Comment 4 Christophe Besson 2019-11-06 10:30:09 UTC
Thanks, and what about the 2nd (related) issue about the DOMAIN definition? Should I open another bug for that one?

Comment 5 Lukáš Nykrýn 2019-11-11 09:12:36 UTC
Yeah, maybe it would be better to have this covered in separated bugs. Since the nameserver part was a bugfix, while the domain part is RFE.

Comment 13 errata-xmlrpc 2021-05-18 15:02:41 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 (dracut 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:1661


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