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.

Bug 2046540

Summary: 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::".
Product: Red Hat Enterprise Linux 8 Reporter: Harald Jensås <hjensas>
Component: cloud-initAssignee: Emanuele Giuseppe Esposito <eesposit>
Status: CLOSED ERRATA QA Contact: xiachen
Severity: high Docs Contact:
Priority: high    
Version: 8.2CC: eesposit, eterrell, huzhao, jgreguske, xiachen, xiliang, yacao
Target Milestone: rcKeywords: ZStream
Target Release: 8.2Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cloud-init-21.1-14.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2053546 2060024 2060025 2060026 (view as bug list) Environment:
Last Closed: 2022-05-10 13:35:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2053546, 2060024, 2060025, 2060026    

Description Harald Jensås 2022-01-26 22:21:50 UTC
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.

Comment 1 Harald Jensås 2022-02-08 15:36:49 UTC
Fix merged upstream.

https://github.com/canonical/cloud-init/pull/1215

Comment 12 Huijuan Zhao 2022-03-01 01:12:18 UTC
Move to VERIFIED per comment 9

Comment 19 errata-xmlrpc 2022-05-10 13:35:26 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 (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