diff options
author | Eduardo Otubo <otubo@redhat.com> | 2020-12-01 15:51:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-01 09:51:47 -0500 |
commit | f550c8765ca03d313e54edf35209b877ef3381ff (patch) | |
tree | 543ba015332cf97a3a774bc09ca222df53a8cecf | |
parent | 2bd34bda9543c1b66f53eaf26706f0de887db187 (diff) | |
download | vyos-cloud-init-f550c8765ca03d313e54edf35209b877ef3381ff.tar.gz vyos-cloud-init-f550c8765ca03d313e54edf35209b877ef3381ff.zip |
Adding BOOTPROTO = dhcp to render sysconfig dhcp6 stateful on RHEL (#685)
BOOTPROTO needs to be set to 'dhcp' on RHEL so NetworkManager can
properly acquire ipv6 address.
rhbz: #1859695
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
Co-authored-by: Daniel Watkins <oddbloke@ubuntu.com>
Co-authored-by: Scott Moser <smoser@brickies.net>
-rw-r--r-- | cloudinit/net/sysconfig.py | 6 | ||||
-rw-r--r-- | tests/unittests/test_net.py | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py index a930e612..ba85584e 100644 --- a/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py @@ -396,6 +396,12 @@ class Renderer(renderer.Renderer): # Only IPv6 is DHCP, IPv4 may be static iface_cfg['BOOTPROTO'] = 'dhcp6' iface_cfg['DHCLIENT6_MODE'] = 'managed' + # only if rhel AND dhcpv6 stateful + elif (flavor == 'rhel' and + subnet_type == 'ipv6_dhcpv6-stateful'): + iface_cfg['BOOTPROTO'] = 'dhcp' + iface_cfg['DHCPV6C'] = True + iface_cfg['IPV6INIT'] = True else: iface_cfg['IPV6INIT'] = True # Configure network settings using DHCPv6 diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py index 70453683..8b34e0c9 100644 --- a/tests/unittests/test_net.py +++ b/tests/unittests/test_net.py @@ -1365,7 +1365,7 @@ NETWORK_CONFIGS = { }, 'expected_sysconfig_rhel': { 'ifcfg-iface0': textwrap.dedent("""\ - BOOTPROTO=none + BOOTPROTO=dhcp DEVICE=iface0 DHCPV6C=yes IPV6INIT=yes |