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 1910438 - RHEL 8.3 anaconda fails to propagate static IP provided on kernel command via 'ip=' to installed OS instance.
Summary: RHEL 8.3 anaconda fails to propagate static IP provided on kernel command via...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: anaconda
Version: 8.3
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 8.0
Assignee: Anaconda Maintenance Team
QA Contact: Release Test Team
URL:
Whiteboard:
: 1940513 (view as bug list)
Depends On: 1915493
Blocks: 1940513
TreeView+ depends on / blocked
 
Reported: 2020-12-23 22:45 UTC by James Hartsock
Modified: 2024-12-20 19:29 UTC (History)
12 users (show)

Fixed In Version: anaconda-33.16.4.15-1.el8
Doc Type: Bug Fix
Doc Text:
Cause: After replacement of dracut network module with NetworkManager in initramfs in RHEL 8.3 the BOOTIF boot option was not used to select the interface for static network configuration set by ip= dracut boot option with interface specification left out. Consequence: On installed system the interface specified by the BOOTIF option was configured to use DHCP. Fix: Anaconda's methods for finding the right connection to be passed to the installed system were updated to match the right connections created by NetworkManager based on the boot options. Result: In case of static configuration via ip= boot option with unspecified interface, the interface specified by BOOTIF option is now configured with the expected static configuration on the installed system.
Clone Of:
: 1940513 (view as bug list)
Environment:
Last Closed: 2021-05-18 15:47:13 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5668441 0 None None None 2020-12-23 22:53:33 UTC

Description James Hartsock 2020-12-23 22:45:12 UTC
Description of problem:
Previous RHEL 8 version, you were able to provide static IP, netmask, gateway, hsotanme, DNS via the ip= kernel command line and this information would be used for install and propagated to the final OS instance. No 'network' lines required in the kickstart file.

With RHEL 8.3 switch to using NetworkManager module in dracut (initramfs), the ip= information is used for anaconda install.  However, the NIC is configured to use DHCP in installed OS instance.

Version-Release number of selected component (if applicable):
anaconda 33.16.3.26-1.el8
NetworkManager (version 1.26.0-12.el8_3)

How reproducible:
100%

Steps to Reproduce:
1. Boot system with ip= specifying all needed fields, and no network config in kickstart.
2. Note that anaconda uses information at install
3. Once reboot, system will be using DHCP


Actual results:
[anaconda root@localhost ~]# cat /proc/cmdline
initrd=RHEL83_initrd.img inst.stage2=http://172.31.0.1/repos/rhel8.3/
                         inst.repo=http://172.31.0.1/repos/rhel8.3/
                         inst.ks=http://172.31.0.1/KS/8.3/virt-min.cfg
                         console=tty0 console=ttyS0,115200
                         BOOTIF=52-54-00-33-00-94
                         ip=192.168.122.254::192.168.122.1:255.255.255.0:testhost.example.com::none:172.31.0.1:172.31.0.2

[anaconda root@localhost ~]# ip route
default via 192.168.122.1 dev enp1s0f2 proto static metric 100 <<<<<<<<<<<<<<<<<<<<<<<<<<< Using static IP
192.168.122.0/24 dev enp1s0f2 proto kernel scope link src 192.168.122.254 metric 100

[anaconda root@localhost ~]# nmcli con show enp1s0f2 | egrep '(ipv4\.)(method|addresses|gateway|dns):'
ipv4.method:                            auto <<<<<<<<<<<<<<<<<<<<<<<< But connection configured for DHCP!!!!
ipv4.dns:                               --
ipv4.addresses:                         --
ipv4.gateway:                           --



Expected results (RHEL 8.1 & 8.2 did during anaconda):
[anaconda root@testhost ~]# cat /proc/cmdline
initrd=RHEL82_initrd.img inst.stage2=http://172.31.0.1/repos/rhel8.2/
                         inst.repo=http://172.31.0.1/repos/rhel8.2/
                         inst.ks=http://172.31.0.1/KS/8.2/virt-min.cfg
                         console=tty0 console=ttyS0,115200
                         BOOTIF=52-54-00-33-00-94
                         ip=192.168.122.254::192.168.122.1:255.255.255.0:testhost.example.com::none:172.31.0.1:172.31.0.2

[root@testhost ~]# ip route
default via 192.168.122.1 dev enp1s0f2 proto static metric 100
192.168.122.0/24 dev enp1s0f2 proto kernel scope link src 192.168.122.254 metric 100

[root@testhost ~]# nmcli con show enp1s0f2 | egrep '(ipv4\.)(method|addresses|gateway|dns):'
ipv4.method:                            manual
ipv4.dns:                               --
ipv4.addresses:                         192.168.122.254/24
ipv4.gateway:                           192.168.122.1



Additional info:

Comment 1 James Hartsock 2020-12-23 22:56:56 UTC
Copied my 'ip route' not 'ip addr' by mistake for the failing RHEL 8.3

[anaconda root@localhost ~]# ip -4 addr
4: enp1s0f2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    inet 192.168.122.254/24 brd 192.168.122.255 scope global noprefixroute enp1s0f2 <<<<<<< Using command line static ip=
       valid_lft forever preferred_lft forever

Comment 5 Radek Vykydal 2021-01-04 13:27:58 UTC
Yes, if the interface is not specified in ip= dracut configuration Anaconda fails to dump the generic "Wired Connection" created in initramfs into enp1s0f1 configuration file and creates default connection using auto/dhcp ipv4 method.

This has been fixed upstream by https://github.com/rhinstaller/anaconda/commit/05a80bb599d6e2ea694279ed4257a11a361b894d . I think it should be possible to port the fix to RHEL 8.4.

Comment 6 James Hartsock 2021-01-04 13:55:04 UTC
As regression in RHEL 8.0, 8.1, 8.2 behavior and impacting installing of RHEL 8 is there a z-stream planned?

Comment 8 James Hartsock 2021-01-04 21:41:41 UTC
Customer is only using 1 ip=, the multiple was me testing more differences between 8.2 & 8.3 with move to NetworkManager in initramfs.

Customer is booting system for install (anaconda) only knowing the MAC address of the NIC.  The ip= only allows to specify <interface> via name; however legacy network scripts have always allowed this to be blank when and uses the NIC specified in BOOTIF.  Looking to have this same for RHEL 8.3 (and later) anaconda installs too.  And per my testing NetworkManager seems to too; however, it uses 'Wired Conenction' as name and thus final install image doesn't have NIC configured as did in 8.0, 8.1, and 8.2.

Syntax in use is:
  ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]

Example is in comment 0
  BOOTIF=52-54-00-33-00-94 ip=192.168.122.254::192.168.122.1:255.255.255.0:testhost.example.com::none:172.31.0.1:172.31.0.2

Comment 10 Jan Stodola 2021-01-05 18:55:31 UTC
Before fixing anaconda (this bug), I would recommend:
* reporting a new bug against NetworkManager to clarify if ip= without the interface name is supported or not to prevent any unexpected surprises in the future.
* reporting a new bug against dracut, since "man nm-initrd-generator" refers to "dracut.cmdline(7) manual for the documentation of the precise format of the values supported". Also the installation guide refers dracut.cmdline man page [1]. So dracut's man page needs be updated or the references changed with the updated syntax:

ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:[<interface>]:{none|off|dhcp|on|any|dhcp6|auto6|ibft}[:[<dns1>][:<dns2>]]

[1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/performing_a_standard_rhel_installation/custom-boot-options_installing-rhel#network-boot-options_custom-boot-options

Comment 11 James Hartsock 2021-01-05 19:04:47 UTC
Sounds like plan to me, go for it!

If anaconda has a different syntax to boot and install a system only knowing the MAC address with resulting installed OS image still using Predictable Network Interface Name, I welcome the syntax.

If you use the ifname= to assign name to the MAC-Address and use that name in ip= ... anaconda ends up using this name/alias.

Comment 12 James Hartsock 2021-01-05 19:11:20 UTC
BTW - RHEL 7 still supported the RHEL 6 method of following ... so am aware of that method, just not another one for RHEL 8 anaconda.
  BOOTIF=<MAC> ip=<IP> gateway=<GW> netmask=<Mask> hostname=rhel7.example.com

Comment 13 James Hartsock 2021-01-12 13:43:51 UTC
Any word on the new BZs?
Or, other ways to accomplish setting static IP while maintain persistent network names when only know MAC address for install for RHEL 8?

Comment 14 Jan Stodola 2021-01-12 18:05:28 UTC
Bug 1915493 reported against NetworkManager.

Comment 15 Radek Vykydal 2021-03-17 06:19:26 UTC
PR for Anaconda kickstart test covering the use case:
https://github.com/rhinstaller/kickstart-tests/pull/494

Comment 20 Radek Vykydal 2021-03-18 08:05:58 UTC
Port of the PR from comment #5:

https://github.com/rhinstaller/anaconda/pull/3246

It has passed all kickstart network tests.

Scratch build with the patch:
http://brew-task-repos.usersys.redhat.com/repos/scratch/rvykydal/anaconda/33.16.4.13/2.el8/

Comment 24 Radek Vykydal 2021-03-23 10:12:38 UTC
https://github.com/rhinstaller/anaconda/pull/3246

Comment 25 Radek Vykydal 2021-03-24 08:08:58 UTC
Additional patch dealing with use case from https://bugzilla.redhat.com/show_bug.cgi?id=1915493#c43:
https://github.com/rhinstaller/anaconda/pull/3258

Comment 26 Radek Vykydal 2021-03-24 09:32:19 UTC
(In reply to Radek Vykydal from comment #25)
> Additional patch dealing with use case from
> https://bugzilla.redhat.com/show_bug.cgi?id=1915493#c43:
> https://github.com/rhinstaller/anaconda/pull/3258

I am running kickstart tests on compose/iso with latest anaconda (conmment #24, comment #25) and NM (https://bugzilla.redhat.com/show_bug.cgi?id=1915493#c38) updates:

http://file.brq.redhat.com/rvykydal/rhbz1910438/boot_anaconda_33.16.4.14-2_nm_1.30.0-4.2.iso

created with

lorax --product="Red Hat Enterprise Linux" --version=8.4 --release=8.4 \
  --workdir ./lorax-work \
  --variant=BaseOS --nomacboot --buildarch=x86_64 --volid=RHEL-8-4-0-BaseOS-x86_64 \
  -s http://download.eng.brq.redhat.com/nightly/rhel-8/RHEL-8/latest-RHEL-8.4/compose/BaseOS/x86_64/os/ \
  -s http://download.eng.brq.redhat.com/nightly/rhel-8/RHEL-8/latest-RHEL-8.4/compose/AppStream/x86_64/os/ \
  -s http://download.eng.brq.redhat.com/nightly/rhel-8/RHEL-8/latest-RHEL-8.4/compose/CRB/x86_64/os/ \
  -s http://brew-task-repos.usersys.redhat.com/repos/scratch/bgalvani/NetworkManager/1.30.0/4.1.bz1915493.el8/x86_64/ \
  -s http://brew-task-repos.usersys.redhat.com/repos/scratch/rvykydal/anaconda/33.16.4.14/2_rhbz1910438.el8/x86_64 \
  ./1910438_c25/


New kickstart test for the additional patch (ip= static configuration with device specified by MAC): https://github.com/rhinstaller/kickstart-tests/pull/497

Comment 32 Radek Vykydal 2021-03-30 12:38:26 UTC
Updating the Doc Text field with a draft.

Comment 33 Jiri Konecny 2021-04-15 16:19:40 UTC
*** Bug 1940513 has been marked as a duplicate of this bug. ***

Comment 35 errata-xmlrpc 2021-05-18 15:47:13 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 (anaconda 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:1844


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