Red Hat Bugzilla – 2046540 – cloud-init writes route6-$DEVICE config with a HEX netmask. ip route does not like : Error: inet6 prefix is expected rather than "fd00:fd00:fd00::/ffff:ffff:ffff:ffff::".
Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
cloud-init writes route6-$DEVICE config with a HEX netmask. ip route does not like : Error: inet6 prefix is expected rather than "fd00:fd00:fd00::/ffff:ffff:ffff:ffff::".
Description of problem:
The routes put in route6-$DEVICE by cloud-init is in an invalid format.
The schema[1] for network_matadata uses a non-converntinal format for the IPv6 netmask. It is stored as an IPv6 address, similar to how IPv4 netmasks are written 255.255.255.0 the IPv6 netmask is written as FFFF:FFFF:FFFF:FFFF:: in the network metadata.
cloud-init does not translate this. So you end up with:
cat /etc/sysconfig/network-scripts/route6-ens3
# Created by cloud-init on instance boot automatically, do not edit.
#
::/:: via fd00:fd00:fd00:2::fffe dev ens3
fd00:fd00:fd00:1::/ffff:ffff:ffff:ffff:: via fd00:fd00:fd00:2::fffe dev ens3
fd00:fd00:fd00::/ffff:ffff:ffff:ffff:: via fd00:fd00:fd00:2::fffe dev ens3
The result is that the routes are ignored since it is not a valid inet6 prefix.
[1] https://docs.openstack.org/nova/latest/_downloads/9119ca7ac90aa2990e762c08baea3a36/network_data.json
Version-Release number of selected component (if applicable):
cloud-init-18.5-12.el8.noarch.rpm
How reproducible:
Steps to Reproduce:
1. Example network_data.json generated by openstack nova
$ cat /mnt/openstack/latest/network_data.json
{"links": [{"id": "tapa0d73196-22", "vif_id": "a0d73196-22d3-454e-9780-8d74e4095e39", "type": "phy", "mtu": 1442, "ethernet_mac_address": "fa:16:3e:2a:23:17"}], "networks": [{"id": "network0", "type": "ipv6_dhcpv6-stateful", "link": "tapa0d73196-22", "ip_address": "fd00:fd00:fd00:2::1:191", "netmask": "ffff:ffff:ffff:ffff::", "routes": [{"network": "::", "netmask": "::", "gateway": "fd00:fd00:fd00:2::fffe"}, {"network": "fd00:fd00:fd00:1::", "netmask": "ffff:ffff:ffff:ffff::", "gateway": "fd00:fd00:fd00:2::fffe"}, {"network": "fd00:fd00:fd00::", "netmask": "ffff:ffff:ffff:ffff::", "gateway": "fd00:fd00:fd00:2::fffe"}], "network_id": "d13eea09-f4a7-425c-94c8-45c6b92e1f99", "services": [{"type": "dns", "address": "fd00:fd00:fd00:0002::1"}]}], "services": [{"type": "dns", "address": "fd00:fd00:fd00:0002::1"}]}
2. Use above metadata and let cloud-init configure the networking.
Actual results:
Jan 26 14:12:45 overcloud-novacompute-0 NetworkManager[1027]: <warn> [1643206365.7973] ifcfg-rh: ignoring invalid route at "::/:: via fd00:fd00:fd00:2::fffe dev ens3" (/etc/sysconfig/network-scripts/route6-ens3:3): Argument for "::/::" is not ADDR/PREFIX format
Jan 26 14:12:45 overcloud-novacompute-0 NetworkManager[1027]: <warn> [1643206365.7977] ifcfg-rh: ignoring invalid route at "fd00:fd00:fd00:1::/ffff:ffff:ffff:ffff:: via fd00:fd00:fd00:2::fffe dev ens3" (/etc/sysconfig/network-scripts/route6-ens3:4): Argument for "fd00:fd00:fd00:1::/ffff:ffff:ffff:ffff::" is not ADDR/PREFIX format
Jan 26 14:12:45 overcloud-novacompute-0 NetworkManager[1027]: <warn> [1643206365.7979] ifcfg-rh: ignoring invalid route at "fd00:fd00:fd00::/ffff:ffff:ffff:ffff:: via fd00:fd00:fd00:2::fffe dev ens3" (/etc/sysconfig/network-scripts/route6-ens3:5): Argument for "fd00:fd00:fd00::/ffff:ffff:ffff:ffff::" is not ADDR/PREFIX format
ip -6 route add fd00:fd00:fd00::/ffff:ffff:ffff:ffff:: via fd00:fd00:fd00::1
Error: inet6 prefix is expected rather than "fd00:fd00:fd00::/ffff:ffff:ffff:ffff::".
Expected results:
The netmask should be the decimal number in CIDR annotation.
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 (cloud-init 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-2022:1776