Skip to content

net: fix ipv6_dhcpv6_stateful/stateless/slaac configuration for rhel (#4395)

Ani Sinha requested to merge anisinha/cloud-init:fix-167372 into c9s

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2227767


When network type is ipv6_dhcpv6-stateful/stateless/slaac, cloud-init seems to enable dhcp for both ipv4 and ipv6. Network manager prefers dhcp over ipv4 and hence dhcp6 is not used to obtain the IP address. This is incorrect. For only ipv6_dhcpv6-stateful/stateless/slaac networks, we should set:
ipv4.method = disabled // disables all ipv4 dhcp

For ifcfg files (sysconfig renderer), the corresponding changes should be:
BOOTPROTO = none // instead of dhcp so that dhcp4 is disabled.

Additionally, for only ipv6_dhcpv6_stateful, we should set:
ipv6.may-fail = no // dhcp6 must succeed.

which translates to the following ifcfg setting:
IPV6_FAILURE_FATAL = yes // so that dhcp6 should succeed.

This patch fixes this for rhel. The patch has been tested by Red Hat QE.

RHBZ: 2046491
fixes: f550c8765ca03d3 ("Adding BOOTPROTO = dhcp to render sysconfig dhcp6 stateful on RHEL (#685)")

Signed-off-by: Ani Sinha <anisinha@redhat.com>
(cherry picked from commit fd214a1243011275c5dffb92b481c235e4c7a1bf)
Edited by Camilla Conte

Merge request reports