get_lxc_ip does not work in environments that are IPv6-only (IPv4 expected). #2369

Closed
opened 2026-02-05 04:38:28 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @thesyntaxslinger on GitHub (Jan 23, 2026).

Have you read and understood the above guidelines?

yes

🔎 Did you run the script with verbose mode enabled?

Yes, verbose mode was enabled and the output is included below

📜 What is the name of the script you are using?

Homepage

📂 What was the exact command used to execute the script?

update or bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/homepage.sh)"

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 13

📈 Which Proxmox version are you on?

pve-manager/9.1.4/5ac30304265fbd8e (running kernel: 6.17.4-2-pve)

📝 Provide a clear and concise description of the issue.

First of all, not here to argue about IPv4/IPv6 — I run NAT64 and DNS64 in my home setup and prefer to just handle setting up IPv6 everywhere rather than both dualstack with V4 + V6.

In a IPv6 only environment, there is no available IPv4 address for the function in https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func — get_current_ip()
^^ since it has hardcoded IPv4 addresses in the function that are never going to be accecssible in a IPv6-only environment.

The script actually calls the function get_lxc_ip() first which is here https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func — which then calls the get_current_ip() function inside of itself.

🔄 Steps to reproduce the issue.

Remove IPv4 from LXC container and then try and run the update command.

Paste the full error output (if available).

    __  __                                          
   / / / /___  ____ ___  ___  ____  ____ _____ ____ 
  / /_/ / __ \/ __ `__ \/ _ \/ __ \/ __ `/ __ `/ _ \
 / __  / /_/ / / / / / /  __/ /_/ / /_/ / /_/ /  __/
/_/ /_/\____/_/ /_/ /_/\___/ .___/\__,_/\__, /\___/ 
                          /_/          /____/       

  ✖️   Could not determine LOCAL_IP
  ✖️   in line 31: exit code 1 (General error / Operation not permitted): while executing command return 1

🖼️ Additional context (optional).

Here is the function that is being called that is failing.

get_current_ip() {
    local targets=("8.8.8.8" "1.1.1.1" "192.168.1.1" "10.0.0.1" "172.16.0.1" "default")
    local ip

    for target in "${targets[@]}"; do
        if [[ "$target" == "default" ]]; then
            ip=$(ip route get 1 2>/dev/null | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')
        else
            ip=$(ip route get "$target" 2>/dev/null | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')
        fi
        if [[ -n "$ip" ]]; then
            echo "$ip"
            return 0
        fi
    done

    return 1
}
Originally created by @thesyntaxslinger on GitHub (Jan 23, 2026). ### ✅ Have you read and understood the above guidelines? yes ### 🔎 Did you run the script with verbose mode enabled? Yes, verbose mode was enabled and the output is included below ### 📜 What is the name of the script you are using? Homepage ### 📂 What was the exact command used to execute the script? update or bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/homepage.sh)" ### ⚙️ What settings are you using? - [ ] Default Settings - [x] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 13 ### 📈 Which Proxmox version are you on? pve-manager/9.1.4/5ac30304265fbd8e (running kernel: 6.17.4-2-pve) ### 📝 Provide a clear and concise description of the issue. First of all, not here to argue about IPv4/IPv6 — I run NAT64 and DNS64 in my home setup and prefer to just handle setting up IPv6 everywhere rather than both dualstack with V4 + V6. In a IPv6 only environment, there is no available IPv4 address for the function in https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func — get_current_ip() ^^ since it has hardcoded IPv4 addresses in the function that are never going to be accecssible in a IPv6-only environment. The script actually calls the function get_lxc_ip() first which is here https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/core.func — which then calls the get_current_ip() function inside of itself. ### 🔄 Steps to reproduce the issue. Remove IPv4 from LXC container and then try and run the update command. ### ❌ Paste the full error output (if available). ``` __ __ / / / /___ ____ ___ ___ ____ ____ _____ ____ / /_/ / __ \/ __ `__ \/ _ \/ __ \/ __ `/ __ `/ _ \ / __ / /_/ / / / / / / __/ /_/ / /_/ / /_/ / __/ /_/ /_/\____/_/ /_/ /_/\___/ .___/\__,_/\__, /\___/ /_/ /____/ ✖️ Could not determine LOCAL_IP ✖️ in line 31: exit code 1 (General error / Operation not permitted): while executing command return 1 ``` ### 🖼️ Additional context (optional). Here is the function that is being called that is failing. ```bash get_current_ip() { local targets=("8.8.8.8" "1.1.1.1" "192.168.1.1" "10.0.0.1" "172.16.0.1" "default") local ip for target in "${targets[@]}"; do if [[ "$target" == "default" ]]; then ip=$(ip route get 1 2>/dev/null | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}') else ip=$(ip route get "$target" 2>/dev/null | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}') fi if [[ -n "$ip" ]]; then echo "$ip" return 0 fi done return 1 } ```
OVERLORD added the bug label 2026-02-05 04:38:28 +03:00
Author
Owner

@MickLesk commented on GitHub (Jan 23, 2026):

Then make an Approve that the URLs Work?

Deploy Homepage with ipv4. Disable after this. Edit the env for ipv6 and Test ?

I dont think we add this. It make the most env more complex and the most env does run ipv4 as http

@MickLesk commented on GitHub (Jan 23, 2026): Then make an Approve that the URLs Work? Deploy Homepage with ipv4. Disable after this. Edit the env for ipv6 and Test ? I dont think we add this. It make the most env more complex and the most env does run ipv4 as http
Author
Owner

@thesyntaxslinger commented on GitHub (Jan 23, 2026):

@MickLesk That is fair enough.
How come a PR was added that added the IPv6 fallback anyways?

@thesyntaxslinger commented on GitHub (Jan 23, 2026): @MickLesk That is fair enough. How come a PR was added that added the IPv6 fallback anyways?
Author
Owner

@MickLesk commented on GitHub (Jan 23, 2026):

So that Issue 10x isn't opened, but it should be said that I have no idea whether the .env files can resolve this at all; at least the build works.

But to be honest, there's no reason to disable the local ipv4 yourself 😄

@MickLesk commented on GitHub (Jan 23, 2026): So that Issue 10x isn't opened, but it should be said that I have no idea whether the .env files can resolve this at all; at least the build works. But to be honest, there's no reason to disable the local ipv4 yourself :smile:
Author
Owner

@thesyntaxslinger commented on GitHub (Jan 24, 2026):

@MickLesk There are many reasons to disable the local IPv4 — but it's not for everyone that doesn't want to learn new things like NAT64 and DNS64.

I essentially setup IPv6 only and don't touch IPv4 anymore (less sys-admin work in my home environment).

  • No more split-horizon DNS due to GUA's.
  • No more hairpinning LAN connections through my router due to smart browsers like chrome wanting to use 8.8.8.8 everywhere (now I can just find the GUA on-link).
  • No functionality loss of IPv4-only websites due to NAT64 and DNS64.
  • I can have more than /24 devices in a single subnet (you can achieve this with another subnet like a /16 or even a /20 with IPv4, but how about a /64 of IPv6?!?!).

I can shill IPv6 on and on if you want 😉

@thesyntaxslinger commented on GitHub (Jan 24, 2026): @MickLesk There are many reasons to disable the local IPv4 — but it's not for everyone that doesn't want to learn new things like NAT64 and DNS64. I essentially setup IPv6 only and don't touch IPv4 anymore (less sys-admin work in my home environment). - No more split-horizon DNS due to GUA's. - No more hairpinning LAN connections through my router due to smart browsers like chrome wanting to use 8.8.8.8 everywhere (now I can just find the GUA on-link). - No functionality loss of IPv4-only websites due to NAT64 and DNS64. - I can have more than /24 devices in a single subnet (you can achieve this with another subnet like a /16 or even a /20 with IPv4, but how about a /64 of IPv6?!?!). I can shill IPv6 on and on if you want 😉
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#2369