From a9255417d44b33865a3d327d678e5437ec44794a Mon Sep 17 00:00:00 2001 From: Phill Fernandes Date: Tue, 1 Sep 2026 08:50:21 -0400 Subject: [PATCH] fix(add-iptag): merge live IPv4 addresses for running LXCs (#16691) --- tools/pve/add-iptag.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/pve/add-iptag.sh b/tools/pve/add-iptag.sh index a1709a6d2..a2714f52f 100644 --- a/tools/pve/add-iptag.sh +++ b/tools/pve/add-iptag.sh @@ -1003,8 +1003,10 @@ get_lxc_ips() { fi fi - # Method 3: Direct container command to get ALL IPs if previous methods failed - if [[ -z "$ips" ]]; then + # Method 3: Merge live IPv4 addresses from running containers. + # Earlier methods can find only the primary net0/eth0 address; this probe + # also discovers Docker bridges, Tailscale, and other guest interfaces. + if [[ "${STATUS_CACHE[lxc_${vmid}]:-}" == "running" ]]; then local container_ips=$(timeout 5s pct exec "$vmid" -- ip -4 addr show 2>/dev/null | grep -oE 'inet ([0-9]{1,3}\.){3}[0-9]{1,3}' | awk '{print $2}' | grep -v '127.0.0.1') if [[ -n "$container_ips" ]]; then while IFS= read -r ip; do