From 120814fa499b431e1da7c46e9648781483a894b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Fri, 24 Nov 2023 14:50:17 +0100 Subject: [PATCH] Add IPv6 support for network attachements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When NETWORK_ISOLATION_IPV6 (default: false) is true, configure the NAD for IPv6. Likewize NETWORK_ISOLATION_IPV4 (default: true) controls if IPv4 is configured. Enabling both IPv6 and IPv4 should work for dual stack. Signed-off-by: Harald Jensås --- scripts/gen-netatt.sh | 125 +++++++++++++++++++++++++++++------------- 1 file changed, 88 insertions(+), 37 deletions(-) diff --git a/scripts/gen-netatt.sh b/scripts/gen-netatt.sh index 66df9df3c..e2041bd65 100644 --- a/scripts/gen-netatt.sh +++ b/scripts/gen-netatt.sh @@ -39,15 +39,6 @@ if [ -z "${VLAN_STEP}" ]; then echo "Please set VLAN_STEP"; exit 1 fi -if [ -z "$IPV4_ENABLED" ] && [ -z "$IPV6_ENABLED" ]; then - echo "Please enable either IPv4 or IPv6 by setting IPV4_ENABLED or IPV6_ENABLED"; exit 1 -fi - -if [ -n "$IPV4_ENABLED" ] && [ -n "$IPV6_ENABLED" ]; then - echo "Dual stack not supported, cannot enable both IPv4 and IPv6"; exit 1 -fi - - echo DEPLOY_DIR ${DEPLOY_DIR} echo INTERFACE ${INTERFACE} echo VLAN_START ${VLAN_START} @@ -78,21 +69,36 @@ spec: "master": "${BRIDGE_NAME}", "ipam": { "type": "whereabouts", + "ipRanges": [ EOF_CAT if [ -n "$IPV4_ENABLED" ]; then cat >> ${DEPLOY_DIR}/ctlplane.yaml <> ${DEPLOY_DIR}/ctlplane.yaml <> ${DEPLOY_DIR}/ctlplane.yaml <> ${DEPLOY_DIR}/ctlplane.yaml <> ${DEPLOY_DIR}/ctlplane.yaml <> ${DEPLOY_DIR}/internalapi.yaml <> ${DEPLOY_DIR}/internalapi.yaml <> ${DEPLOY_DIR}/internalapi.yaml <> ${DEPLOY_DIR}/internalapi.yaml <> ${DEPLOY_DIR}/internalapi.yaml <> ${DEPLOY_DIR}/storage.yaml <> ${DEPLOY_DIR}/storage.yaml <> ${DEPLOY_DIR}/storage.yaml <> ${DEPLOY_DIR}/storage.yaml <> ${DEPLOY_DIR}/storage.yaml <> ${DEPLOY_DIR}/tenant.yaml <> ${DEPLOY_DIR}/tenant.yaml <> ${DEPLOY_DIR}/tenant.yaml <> ${DEPLOY_DIR}/tenant.yaml <> ${DEPLOY_DIR}/tenant.yaml <