Bug 1497358

Summary: cloud-init renders ipv6 route incorrectly
Product: Red Hat Enterprise Linux 7 Reporter: Ben Howard <bh>
Component: cloud-initAssignee: Ryan McCabe <rmccabe>
Status: CLOSED CURRENTRELEASE QA Contact: xiachen
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: bh, dustymabe, huzhao, jbadiapa, jgreguske, lars, leiwang, merry678garcia, mkrcmari, mmagr, mrezanin, mrunge, myllynen, ribarry, ushkalim, vhutsky, xiachen, yacao, yuxisun
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cloud-init-18.2-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-10 10:53:46 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:

Description Ben Howard 2017-09-29 23:02:02 UTC
Please update cloud-init's with commit 5d9b3d10cf6f066dfec3c025efc7e86deacb52be. 

On systems that use either OpenStack ConfigDrive or DigitalOcean's data-source, Cloud-init on CentOS/Red Hat 7.4 does not assign an IPv6 gateway to eth0.  In the case of ConfigDrive, network_data.json defining the default route will not be assigned (the following is an example snippet):

   "networks": [
      {
         "id": "public-ipv6",
         "ip_address": "2604:A880:0800:00A1:0000:0000:002D:0001/64",
         "link": "interface-public",
         "neutron_network_id": "937c94de-7029-586e-6e36-ea9af2d815de",
         "type": "ipv6",
         "routes": [
            {
               "gateway": "2604:A880:0800:00A1:0000:0000:0000:0001",
               "netmask": "::",
               "network": "::"
            }
         ]

The link is correctly defined in  /etc/sysconfig/network-scripts/ifcfg-eth0 but  /etc/sysconfig/network-scripts/route6-eth0 incorrectly sets the route:
[root@utl-centos-7-x64-25734 ~]# cat /etc/sysconfig/network-scripts/route6-eth0 
# Created by cloud-init on instance boot automatically, do not edit.
#
::/:: via 2604:A880:0800:00A1:0000:0000:0000:0001

This has the effect of configuring IPv6 but the default route is not defined in the routing table.

Comment 2 Ryan McCabe 2017-10-01 00:57:49 UTC
That doesn't seem to be a valid commit id for the upstream master branch.

Comment 3 Ryan McCabe 2017-10-01 01:04:19 UTC
Is this the one that fixes it for you: https://git.launchpad.net/cloud-init/commit/?id=d00da2d5b0d45db5670622a66d833d2abb907388 ?

Comment 4 Ben Howard 2017-10-02 12:29:57 UTC
In regards to Comment #3, https://git.launchpad.net/cloud-init/commit/?id=d00da2d5b0d45db5670622a66d833d2abb907388 is the commit that I was requesting.

Comment 6 Dusty Mabe 2017-10-02 18:09:46 UTC
can we set a better title for this BZ?

Comment 12 xiachen 2020-09-10 10:53:46 UTC
Upstream commits which were merged in cloud-init 17.1, fixed this issue,
https://github.com/canonical/cloud-init/commit/d00da2d5b0d45db5670622a66d833d2abb907388
https://github.com/canonical/cloud-init/commit/31fa6f9d0f945868349c033fa049d2467ddcd478

and one commit which was merged in cloud-init 18.4 changed some details, not all types of network would render file route-* and route6-*.
https://github.com/canonical/cloud-init/commit/db50bc0d999e3a90136864a774f85e4e15b144e8

Anyway, the issue is gone in cloud-init 19.4.

Verified cloud-init 19.4, the IPv6 route is rendered correctly.
cloud-init-19.4-11.el8.noarch
cloud-init-19.4-7.el7.noarch

so this bug is closed as fixed in current release.

Comment 13 brandon sherrick 2024-05-04 08:26:06 UTC Comment hidden (spam)
Comment 14 merry678 2024-11-14 06:18:47 UTC
The solution worked for me thanks to the community and the members for the solution.  https://www.ehallpasses.com