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 1147181 - Kickstart installation without default gateway errors out
Summary: Kickstart installation without default gateway errors out
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: anaconda
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jiri Konecny
QA Contact: Release Test Team
URL:
Whiteboard:
: 1206267 (view as bug list)
Depends On:
Blocks: 1133060
TreeView+ depends on / blocked
 
Reported: 2014-09-27 22:41 UTC by Floris
Modified: 2016-05-24 10:40 UTC (History)
10 users (show)

Fixed In Version: anaconda-21.48.22.4-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 09:47:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Bug reporter generated .tar.gz (36.44 KB, application/x-gzip)
2014-10-28 20:49 UTC, Floris
no flags Details
joherr - failing kickstart (2.26 KB, text/plain)
2015-05-26 16:31 UTC, joherr
no flags Details
reproducer.ks (164 bytes, text/x-matlab)
2015-05-27 07:33 UTC, Jiri Konecny
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1177032 0 unspecified CLOSED kickstart install on machine with infiniband interfaces crashes 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1339179 0 unspecified CLOSED Require only --ip= and --netmask for --bootproto=static option of kickstart network command 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2015:2284 0 normal SHIPPED_LIVE anaconda bug fix and enhancement update 2015-11-19 09:44:49 UTC

Internal Links: 1177032 1339179

Description Floris 2014-09-27 22:41:25 UTC
Description of problem:

Fatal exception when you perform a kickstart installation and do not specify a default gateway in the kickstart file.
It should not be necessary to specify a default gateway to perform a network installation in a private network -not connected to the Internet-.

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

CentOS Linux release 7.0.1406

How reproducible:

Always

Steps to Reproduce:

1. perform a kickstart installation with a ks file that contains a network line like:

network --device=eth0 --bootproto=static --ip=192.168.178.45 --netmask=255.255.255.0 --nameserver=127.0.0.1 --hostname=nuc

do not specify --gateway=


Actual results:

Traceback (most recent call last):
  File "/sbin/anaconda", line 1085, in <module>
    networkInitialize(ksdata)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/network.py", line 1199, in networkInitialize
    devnames = apply_kickstart(ksdata)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/network.py", line 1177, in apply_kickstart
    con_uuid = update_settings_with_ksdata(dev_name, network_data)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/network.py", line 443, in update_settings_with_ksdata
    new_values = _get_ip_setting_values_from_ksdata(networkdata)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/network.py", line 397, in _get_ip_setting_values_from_ksdata
    gateway4 = nm.nm_ipv4_to_dbus_int(networkdata.gateway)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/nm.py", line 838, in nm_ipv4_to_dbus_int
    return struct.unpack("=L", socket.inet_aton(address))[0]
error: illegal IP address string passed to inet_aton


Expected results:

Should just accept this valid network configuration.

Comment 3 Martin Banas 2014-10-01 05:59:58 UTC
Hi Floris,
Could you please attach log files from /tmp during the installation? Please attach also /tmp/anaconda-tb-* file.

Thanks!

Comment 4 Floris 2014-10-28 20:49:32 UTC
Created attachment 951547 [details]
Bug reporter generated .tar.gz

Comment 5 David Cantrell 2015-03-25 19:36:25 UTC
Out of curiosity, what happens if you change your url command to:

    url --url=http://192.168.178.100/proxy.php/

That is, drop the double quotes.

Comment 6 Floris 2015-03-25 19:45:31 UTC
David, there is nothing wrong with that line.
Same kickstart template does work fine if you do add a default gateway. (which should not be necessary)

Comment 7 Floris 2015-03-25 20:22:18 UTC
BTW you do seem to already have special handling for the case where there is no IPv6 gateway:

https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/network.py#L414

===
if networkdata.ipv6gateway:
   gateway6 = nm.nm_ipv6_to_dbus_ay(networkdata.ipv6gateway)
else:
   gateway6 = [0] * 16
===



I am guessing you just need to do something similar for IPv4 here:

https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/network.py#L389

===
gateway4 = nm.nm_ipv4_to_dbus_int(networkdata.gateway)
===

Probaby just needs to be changed to something along the lines of:

===
if networkdata.gateway:
   gateway4 = nm.nm_ipv4_to_dbus_int(networkdata.gateway)
else:
   gateway4 = [0] * 4
===

Comment 8 Orion Poplawski 2015-04-09 23:01:31 UTC
This still appears to still be broken in 7.1, and this is killing me on a machine with two interfaces.  I've eventually managed to hack

network --device=eth1 --bootproto=static --ip=192.168.1.11 --netmask=255.255.255.0 --gateway=192.168.1.1 --nameserver=10.10.10.1
network --device=eth0 --bootproto=static --ip=10.10.40.12 --netmask=255.255.0.0 --gateway 10.10.0.1 --nameserver=10.10.10.1

which seems to work, despite eth1 not really having a gateway.

Comment 9 joherr 2015-05-20 21:13:05 UTC
I have the same issue in 7.1. I do not wish to have a gateway defined on all interfaces simply because I do not need them on any but the primary.


The documentation states that you must specify the gateway and nameservers when
using the static method:

~~~~~
The static method requires that you specify the IP address, netmask, gateway, and nameserver in the Kickstart file. This information is static and is used during and after the installation.  
~~~~~

Document Url:  https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html


Although it still functions without the nameservers being specified, it does req
uire the gateway or it fails. Neither of these should be required for an interfa
ce since some subnets are local only and maynot have DNS servers on them.

Can this requirement be removed from the static method and the documentation upd
ated to reflect this?

Comment 10 Martin Banas 2015-05-26 07:24:32 UTC
Hi,
I'm not able to reproduce this issue, trying with one or multiple network lines, with and without --gateway.

Jiri, do you know about any reproducer we could use?

Comment 11 Jiri Konecny 2015-05-26 10:22:27 UTC
Martin, I did some testing and I think the issue is fixed already now.

I think the issue now is that the configuration files are created properly but without the --activate option the configuration files are not loaded by NetworkManager after the installation start so it wasn't change in the "ip addr" command.

For you who still have this problem could you please add option --activate and test it again. If you still have some problems with it, please post here your kickstart file and these logs:

/tmp/*.log
/tmp/syslog

and NetworkManager configuration files:
/etc/sysconfig/network-scripts/ifcfg-[device-name]

Comment 12 joherr 2015-05-26 16:31:03 UTC
Created attachment 1030074 [details]
joherr - failing kickstart

Comment 13 joherr 2015-05-26 16:31:45 UTC
I have been using the --activate option. I am using the latest 7.1 installation DVD from the customer portal.

I have attached a copy of my kickstart file. I did however try again this morning with the attached file.

Comment 14 joherr 2015-05-26 16:39:11 UTC
This should not matter, but I am installing into a virtual machine using the following command.

virt-install --name jh-bug-test \
             --ram 4096 \
             --vcpus 2 \
             --hvm \
             --os-type linux \
             --os-variant rhel7 \
             --disk path=/dev/vg_vms/jh-bug-test \
             --network bridge=IntPublic \
             --network bridge=Provision \
             --initrd-inject /tmp/jh-bug-test.ks \
             --extra-args "ks=file:/jh-bug-test.ks" \
             --noautoconsole \
             --graphics spice \
             --autostart \
             --location rhel-server-7.1-x86_64-dvd.iso

Comment 15 Jiri Konecny 2015-05-27 07:33:06 UTC
Thank you joherr. Now I known what is the problem.

When you use network command in the kickstart normally then during the start dracut creating configuration files and this files are loaded by NetworkManager after the anaconda starts. This working correctly now.

But when you create network settings in pre section which means that the anaconda must connect to NetworkManager and the NetworkManager create the files from what the anaconda tells it. The bug is when anaconda trying to send empty gateway to NetworkManager. I will fix it.

I'm attaching minimal reproducer ks file for you Martin.

Comment 16 Jiri Konecny 2015-05-27 07:33:57 UTC
Created attachment 1030361 [details]
reproducer.ks

Comment 19 Floris 2015-05-27 11:30:54 UTC
Also happens when you do not have a pre section, but fetch the kickstart file from an url (kickstart=http://server/kickstart-generating-script.php), instead of local file.

Comment 20 Jiri Konecny 2015-05-28 10:27:45 UTC
Hello Floris,

I looked on your logs in more detail (comment 4) and I found that you are using network kickstart command without the --device option. This could be problem that the dracut don't know how to parse this option (it's related to bug 1085310). However after this fix and my fix for this bug everything should work. 
Please try the installation with --device=<device name>. With this option dracut should parse it properly.

I would recommend you to always use --device option and if you don't know what device to use please use the --device=link. 

If that logs are not actual please attach new logs with boot options you are using. Thank you.

Comment 21 Floris 2015-05-28 10:52:13 UTC
Dear Jiri,

As I pointed out before, the exact same kickstart file works fine if you do add a gateway parameter.

Note that we are a software development company that makes software to provision dedicated servers in datacenters ( https://www.noc-ps.com/ ).
The profile has been tested on a lot of servers.
For all our customers that use it to provision Internet connected servers it works fine.
For all our customers that are using a private network without gateway for provisioning, it has been broken since 7.0, but worked with 6.x.
Cannot make it any more simple than that.


We do not use --device=link because in datacenter environments more often than not more than one network adapter has a link.
When omitting --device it should be using the device whose MAC address we pass through the ksdevice=$mac parameter instead.
If that no longer works in the development version you are testing with, you got yourself another regression.

Comment 22 Jiri Konecny 2015-05-29 14:45:35 UTC
Dear Floris,

I have found solution for your use case. I created one small patch already and the next one will continue.

Everything should work for you in 7.2.

Comment 24 Radek Vykydal 2015-06-16 13:29:18 UTC
*** Bug 1206267 has been marked as a duplicate of this bug. ***

Comment 27 errata-xmlrpc 2015-11-19 09:47:32 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, 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://rhn.redhat.com/errata/RHBA-2015-2284.html


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