Why doesn't the anaconda `asknetwork` boot parameter work in Red Hat Enterprise Linux 7/8?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8

Issue

  • Installing Red Hat Enterprise Linux 7/8 but asknetwork parameter is not working to get the prompt for submitting IP address information.
  • How to make sure the system gets IP address before installation starts in Red Hat Enterprise Linux 7/8?
  • Anaconda: Dracut fails to correctly configure any network interface
    • See many "Warning: dracut-initqueue timeout -starting timeout scripts" dracut-initqueue messages.
    • See a "Warning: Could not boot." dracut-initqueue message.
    • See a "Warning: /dev/root does not exist" dracut-initqueue message.
    • Dropped to Dracut emergency shell.
    • The /run/initramfs/rdsosreport.txt file shows a "No DHCPOFFERS received." dhclient message.
  • Trying to install RHEL7/8 via a remote source on a machine connected to a DHCP-less network does not prompt the user for the network configuration as it did in the RHEL6 and RHEL5 installers.

Resolution

In Red Hat Enterprise Linux 7/8, the anaconda boot parameter asknetwork is deprecated, so use the ip boot parameter to provide IP information before actual installation begins. There can be two conditions as follows

Systems with Single NIC/Network Interface Card : Append the following anaconda boot parameters to make sure system to have IP information during installation startup for its lone NIC card. It won't be necessary to specify the interface name.

ip=<ip> netmask=<netmask> gateway=<gateway> dns=<nameserver>

Systems with Multiple NIC/Network Interface Cards : One can specify the explicit name of the interface on command line as follows.

ip=<ip> netmask=<netmask> gateway=<gateway> dns=<nameserver> bootdev=<iface_name> ifname=<interface>:<MAC>

The details of the parameters are as follows.

  • bootdev= : This parameter specifies which interface is the boot device and its mandatory to specify if multiple ip= options are used in command line. The syntax is as follows.
bootdev=<interface>
  • ifname= : This assigns the given interface name to the network device with the given MAC. This can be used multiple times for all NICs. (Can be used thrice for three NICs). The syntax of this parameter is as follows. MAC address shall be specified without colons.
ifname=<interface>:<MAC> 

Systems with Multiple NIC/Network Interface Cards and the correct card to use is unknown : One can avoid specifying the specific interface on command line as follows.

ip=<client-IP>::<gateway-IP>:<netmask>:[<hostname>]::off

This will cause dracut to bring up each interface using , and try to arping until it gets a response.

Note: There is a bug in this behavior in RHEL 7.0 which prevents dracut from successfully moving the default gateway to subsequent interfaces if the apring on the first interface fails. This private bug (1137022) is expected to be addressed in a future RHEL 7 release. There are two options to work around this issue until a fix is made available:

Option 1

  • Add the boot parameter rd.break=cmdline at boot time.
  • Edit the /sbin/ifup script.
# sed -i -e 's/ip route add/ip route replace/' /sbin/ifup
  • Exit the shell using the exit command.

Note: You may be returned to the shell a second time before the kickstart continues. Simply exit the shell again using the exit command to continue.

Option 2

  • Make a temporary directory.
# tmpdir=$(mktemp -d -t)
  • Unpack initramfs into it.
# gzip -dc $INITRD | ( cd $tmpdir; cpio -iumd )
  • Edit the /sbin/ifup script.
# sed -i -e 's/ip route add/ip route replace/' $tmpdir/sbin/ifup
  • Make a new initramfs.
# ( cd $tmpdir; find . | cpio -co | gzip -c ) > ${INITRD}.patched
  • Clean up temp directory.
# rm -rf $tmpdir

Dracut Network Options : Dracut provides certain network options which can be used as anaconda boot options as well. The parameter ip= can be used to configure one (or more) network interfaces. It can be used multiple times i.e. One can specify multiple ip arguments to configure multiple interfaces, but if its must to specify an interface for every ip= argument, also it should be specified which interface is the primary boot interface with bootdev. (as mentioned above). This can be used in multiple ways as follows.

  • Get ip information from DHCP or just make it on or both.
ip=[dhcp|on|any]
  • Get ip information from DHCP on a specific interface.
ip=<interface>:[dhcp|on|any|none|off]
  • Get the actually required IP address using ip boot parameter from DHCP server as follows.
ip=<client-IP>:[<server-id>]:<gateway-IP>:<netmask>:<client-hostname>:<interface>:{dhcp|dhcp6|auto6|autoconf|on|any|none|off}
  • In the following command line boot parameter, the IP address, gateway, netmask, hostname and interface is specified. All these parameters are optional if ip=dhcp is used to get this information.
ip=<ip>::<gateway>:<netmask>:<hostname>:<interface>:<autoconf> 
  • To get the ip information from DHCP server but hostname as required or user specified, the following boot parameters can be used.
ip=::::<hostname>::dhcp
  • In above parameters,
    • none, off means static network configuration.
    • dhcp, on , any` mean DHCP IPv4 configuration.
    • dhcp6 is for DHCP IPv6 configuration.
    • autoconf is for automatic IPv4 Configuration.
    • And auto6 is for automatic IPv6 configuration.

Root Cause

  • The anaconda boot parameter asknetwork is deprecated in Red Hat Enterprise Linux 7 and so in Red Hat Enterprise Linux 8.
SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.