From 019a96b20527eaf487808ddfea9dba37ed5bbdbd Mon Sep 17 00:00:00 2001 From: Cobra Date: Wed, 8 Apr 2026 19:37:38 -0400 Subject: [PATCH] Fix flash bugs: remove netplan wifi conflict, suppress eth default route, force IPv4 for Tailscale install - Remove 20-wifi.yaml netplan block (Bug 1): causes netplan to spawn its own wpa_supplicant instance, which claims ctrl_iface and blocks wpa_supplicant@wlan0.service. The per-interface systemd service is the correct approach. - Add cleanup line to remove any pre-existing 20-wifi.yaml from the Armbian image. - Patch 10-dhcp-all-interfaces.yaml to suppress default route on ethernet (Bug 2): without this, ethernet DHCP default route metric 100 beats WiFi metric 1024, routing internet traffic to ethernet which has no upstream. Causes Tailscale and firstboot to fail. - Force IPv4 resolution in Tailscale curl (Bug 3): some homelab/ISP networks lack IPv6 internet routes. IPv6 DNS resolution for tailscale.com causes immediate curl failure on first boot. --- operator_setup.sh | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/operator_setup.sh b/operator_setup.sh index c94ee34..4500791 100755 --- a/operator_setup.sh +++ b/operator_setup.sh @@ -482,21 +482,8 @@ section "Applying Configuration" if [[ -n "$WIFI_SSID" ]]; then step "Writing WiFi profile..." - # Netplan config (primary — renderer: networkd) - mkdir -p "${MOUNT_POINT}/etc/netplan" - cat > "${MOUNT_POINT}/etc/netplan/20-wifi.yaml" << EOF -network: - version: 2 - renderer: networkd - wifis: - wlan0: - dhcp4: yes - dhcp6: no - access-points: - "${WIFI_SSID}": - password: "${WIFI_PASS}" -EOF - chmod 600 "${MOUNT_POINT}/etc/netplan/20-wifi.yaml" + # Remove any netplan wifi config — conflicts with wpa_supplicant@wlan0.service + rm -f "${MOUNT_POINT}/etc/netplan/20-wifi.yaml" # wpa_supplicant direct config (backup — used by wpa_supplicant@wlan0.service) mkdir -p "${MOUNT_POINT}/etc/wpa_supplicant" @@ -543,6 +530,28 @@ EOF info "WiFi profile written (SSID: ${WIFI_SSID})" fi +# Patch ethernet netplan config to suppress default route +step "Patching ethernet netplan config..." +mkdir -p "${MOUNT_POINT}/etc/netplan" +cat > "${MOUNT_POINT}/etc/netplan/10-dhcp-all-interfaces.yaml" << 'EOF' +# Added by Armbian (modified: suppress default route on ethernet) +network: + version: 2 + renderer: networkd + ethernets: + all-eth-interfaces: + match: + name: "e*" + dhcp4: yes + dhcp6: yes + ipv6-privacy: yes + dhcp4-overrides: + use-routes: false + dhcp6-overrides: + use-routes: false +EOF +info "Ethernet netplan patched" + # Root password step "Setting root password..." ROOT_PASS_HASH=$(openssl passwd -6 "$ROOT_PASS") @@ -729,7 +738,7 @@ fi # VPN setup if [[ "${BB_VPN:-}" == "tailscale" && -n "${BB_TAILSCALE_KEY:-}" ]]; then echo "[*] Installing Tailscale..." - curl -fsSL https://tailscale.com/install.sh | sh + curl -4 -fsSL https://tailscale.com/install.sh | sh echo "[*] Connecting to Tailscale..." tailscale up --auth-key="${BB_TAILSCALE_KEY}" --accept-routes || echo "[-] Tailscale auth failed" # Remove auth key from config after use