From f4a9b9bce8e59a59218275495993bb17e5d86da0 Mon Sep 17 00:00:00 2001
From: Gris Ge <fge@redhat.com>
Date: Thu, 5 Sep 2019 21:06:51 +0800
Subject: [PATCH 2/2] nm/ipv6: Enforce IPv6-RA and DHCPv6 address base on MAC
When enslave interface to linux bridge, to ensure the bridge
get the same IPv6 address from IPv6-RA and DHCPv6, change
the 'dhcp_duid' to LL(Link-layer address, RFC 3315) and
'addr_gen_mode' to EUI64.
Signed-off-by: Gris Ge <fge@redhat.com>
---
libnmstate/nm/ipv6.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libnmstate/nm/ipv6.py b/libnmstate/nm/ipv6.py
index 92955ab..9d0bc9b 100644
--- a/libnmstate/nm/ipv6.py
+++ b/libnmstate/nm/ipv6.py
@@ -112,6 +112,12 @@ def create_setting(config, base_con_profile):
if not setting_ip:
setting_ip = nmclient.NM.SettingIP6Config.new()
+ # Ensure IPv6 RA and DHCPv6 is based on MAC address only
+ setting_ip.props.addr_gen_mode = (
+ nmclient.NM.SettingIP6ConfigAddrGenMode.EUI64
+ )
+ setting_ip.props.dhcp_duid = 'll'
+
if not config or not config.get(InterfaceIPv6.ENABLED):
setting_ip.props.method = nmclient.NM.SETTING_IP6_CONFIG_METHOD_IGNORE
return setting_ip
--
2.23.0