[Centos] IPV6_AUTOCONF=no when using dhcp6

Bug #1806014 reported by Herbert Buurman on 2018-11-30
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Medium
Unassigned

Bug Description

When instructing cloud-init to use `type: dhcp6` for the subnet of a physical network interface, the end-result is that `/etc/sysconfig/network` contains `IPV6_AUTOCONF=no`. This causes router advertisements to be ignored and no default route set up.

https://github.com/cloud-init/cloud-init/blob/master/cloudinit/net/network_state.py#L333
This configures `network.use_ipv6 = True`, which is fine.

https://github.com/cloud-init/cloud-init/blob/master/cloudinit/net/sysconfig.py#L649
This configures `IPV6_AUTOCONF=no` to be written whenever `network.use_ipv6` is `True`.
However, in the use-case where dhcp6 is used, `IPV6_AUTOCONF` should be set to `yes`.

Proposed fix:
Distinguish between IPv6 being configured statically or using DHCP when writing the sysconfig file.

Cloud-provider: AWS EC2.
Guest OS: CentOS Linux release 7.5.1804 (Core)
EC2 user-data provided with cloud-init config:
```
#cloud-config
package_upgrade: true
write_files:
- path: /etc/cloud/cloud.cfg.d/99-custom-networking.cfg
  owner: root:root
  permissions: 0600
  content: |
    network:
      version: 1
      config:
      - type: physical
        name: eth0
        subnets:
          - type: dhcp
          - type: dhcp6
power_state:
  mode: reboot
  delay: now
  message: Rebooting post-config
  timeout: 30
  condition: True
```

Herbert Buurman (the-neighbour) wrote :
description: updated
Nick Adams (h-nick-n) wrote :

Also dealing with this bug. Working around it by manually editing /etc/sysconfig/network with bootcmd or manually setting the default route.

Ryan Harper (raharper) wrote :

Thanks for filing the bug. We've another issue related here since the AUTOCONF controls ipv6 router advertisements. the V1 network-config doesn't allow one to express whether you want to opt-in or out of router advertisements which may be desired with either static6 or dhcp6.

In netplan (network-config version=2) one can provide:

accept-ra: true|false

Which in sysconfig rendering could be used to toggle IPV6_AUTOCONF.

Changed in cloud-init:
importance: Undecided → Medium
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments