From e4e126bd4362fda13062c2677b8b4b63e630e071 Mon Sep 17 00:00:00 2001 From: Jino Jose Date: Tue, 30 Jun 2026 16:13:37 +0530 Subject: [PATCH] Disable cloud-init DHCP for static IP setup --- autoinstall/firstboot-setup.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoinstall/firstboot-setup.sh b/autoinstall/firstboot-setup.sh index 9f93518..355fdbc 100644 --- a/autoinstall/firstboot-setup.sh +++ b/autoinstall/firstboot-setup.sh @@ -83,7 +83,9 @@ NET_MODE=$(whiptail --title "$TITLE" \ 3>&1 1>&2 2>&3) if [ "$NET_MODE" = "Static" ]; then - rm -f /etc/netplan/99-cezen-dhcp.yaml || true + mkdir -p /etc/cloud/cloud.cfg.d + printf "network: {config: disabled}\n" > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg + rm -f /etc/netplan/50-cloud-init.yaml /etc/netplan/99-cezen-dhcp.yaml || true IP_ADDR=$(whiptail --title "$TITLE" \ --inputbox "\nEnter static IP address:\n(Example: 192.168.1.100)" \ @@ -123,6 +125,7 @@ network: nameservers: addresses: [${DNS}] EOF + chmod 0600 /etc/netplan/99-cezen-static.yaml if ! netplan apply; then whiptail --title "$TITLE" \