Skip to content

NM renderer: set default IPv6 addr-gen-mode for all interfaces to eui64 (#4291)

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

BZ: 2188388

Cherry-pick from upstream the following commit:

    By default, NetworkManager renderer in cloud-init does not set any specific
    method for IPV6 addr-gen-mode in the keyfiles it writes. Hence, implicitly the
    mode is set to `eui64` in the absence of any global addr-gen-mode option in
    NetworkManager configuration.
    Later when other interfaces get added via D-Bus API or by using nmcli commands
    without explictly setting an addr-gen-mode, NM auto generates new profiles for
    those interfaces with addr-gen-mode set to `stable-privacy`. This introduces
    inconsistency of configurations between interfaces based on how they were
    added. This can cause problems for the customers.
    
    In this change,  cloud-init overrides NetworkManager's preferred default of
    `stable-privacy` to use EUI64 using a drop in NetworkManager configuration
    file. This setting can be overriden by using global-connection-defaults
    setting in /etc/NetworkManager/NetworkManager.conf file.
    
    RHBZ: 2188388
    
    Signed-off-by: Ani Sinha <anisinha@redhat.com>
    (cherry picked from commit d41264cb4297a4b143a23f3677d33b81fbfc6e8e)

Conflicts in unit test code. test_small_config does not have a v1 and v2 in the downstream. Hence there is a conflict here: https://gitlab.com/redhat/centos-stream/src/cloud-init/-/blob/c9s/tests/unittests/test_net.py?ref_type=heads#L5892

Merge request reports