LXC Customisation/Apt always tries to use IPV6 #1348

Closed
opened 2025-11-20 05:08:37 -05:00 by saavagebueno · 2 comments
Owner

Originally created by @mouldybread on GitHub (Jun 24, 2025).

Have you read and understood the above guidelines?

yes

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

go2rtc

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

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

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

📝 Provide a clear and concise description of the issue.

Apt, when run by LXC Container Customisation, tries to use IPV6 - even if it has been disabled with Advanced Settings - and fails if it is not available.

🔄 Steps to reproduce the issue.

Run the script without IPV6

Paste the full error output (if available).

Customizing LXC ContainerW: Failed to fetch http://deb.debian.org/debian/dists/bookworm/InRelease Cannot initiate the connection to debian.map.fastlydns.net:80 (2a04:4e42:600::644). - connect (101: Network is unreachable) Cannot initiate the connection to debian.map.fastlydns.net:80 (2a04:4e42:400::644).

🖼️ Additional context (optional).

No response

Originally created by @mouldybread on GitHub (Jun 24, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? go2rtc ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/go2rtc.sh)" ### ⚙️ What settings are you using? - [x] Default Settings - [x] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 📝 Provide a clear and concise description of the issue. Apt, when run by LXC Container Customisation, tries to use IPV6 - even if it has been disabled with Advanced Settings - and fails if it is not available. ### 🔄 Steps to reproduce the issue. Run the script without IPV6 ### ❌ Paste the full error output (if available). `Customizing LXC ContainerW: Failed to fetch http://deb.debian.org/debian/dists/bookworm/InRelease Cannot initiate the connection to debian.map.fastlydns.net:80 (2a04:4e42:600::644). - connect (101: Network is unreachable) Cannot initiate the connection to debian.map.fastlydns.net:80 (2a04:4e42:400::644).` ### 🖼️ Additional context (optional). _No response_
saavagebueno added the bug label 2025-11-20 05:08:37 -05:00
Author
Owner

@MickLesk commented on GitHub (Jun 25, 2025):

cannot reproduce this. apt should be only use ipv4 if ipv6 disabled.

can you put more input - this script is for your Host, enter the ctid of your lxc.

nano ip6_test.sh

Enter Following:

# Replace <CTID> with your container ID
CTID=<CTID>

echo "LXC Container Network Configuration:"
pct config "$CTID" | grep -E 'net0|ip6=' || echo "No net0/ip6 config found."

echo -e "\nIPv6 Routing inside the Container:"
lxc-attach -n "$CTID" -- ip -6 route show || echo "No IPv6 route found."

echo -e "\nDNS Resolution Test for deb.debian.org:"
lxc-attach -n "$CTID" -- getent ahosts deb.debian.org

echo -e "\nNetwork Connectivity:"
lxc-attach -n "$CTID" -- bash -c "ping -c1 -W1 1.1.1.1 && echo IPv4: OK || echo IPv4: FAIL"
lxc-attach -n "$CTID" -- bash -c "ping6 -c1 -W1 2606:4700:4700::1111 && echo IPv6: OK || echo IPv6: FAIL"

echo -e "\nAPT IPv4/IPv6 Force Configuration:"
lxc-attach -n "$CTID" -- bash -c "grep -r 'Acquire::Force' /etc/apt/apt.conf.d || echo 'No ForceIPv4/6 config found.'"
chmod +x  ip6_test.sh
./ip6_test.sh 

Otherwise we have developed an new ipv6 function in our dev Repo, as default ipv6 for default installs is deactivated:
You can use this Script for Testing (default / default verbose / advanced)

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/debian.sh)"
@MickLesk commented on GitHub (Jun 25, 2025): cannot reproduce this. apt should be only use ipv4 if ipv6 disabled. can you put more input - this script is for your Host, enter the ctid of your lxc. ```bash nano ip6_test.sh ``` Enter Following: ```bash # Replace <CTID> with your container ID CTID=<CTID> echo "LXC Container Network Configuration:" pct config "$CTID" | grep -E 'net0|ip6=' || echo "No net0/ip6 config found." echo -e "\nIPv6 Routing inside the Container:" lxc-attach -n "$CTID" -- ip -6 route show || echo "No IPv6 route found." echo -e "\nDNS Resolution Test for deb.debian.org:" lxc-attach -n "$CTID" -- getent ahosts deb.debian.org echo -e "\nNetwork Connectivity:" lxc-attach -n "$CTID" -- bash -c "ping -c1 -W1 1.1.1.1 && echo IPv4: OK || echo IPv4: FAIL" lxc-attach -n "$CTID" -- bash -c "ping6 -c1 -W1 2606:4700:4700::1111 && echo IPv6: OK || echo IPv6: FAIL" echo -e "\nAPT IPv4/IPv6 Force Configuration:" lxc-attach -n "$CTID" -- bash -c "grep -r 'Acquire::Force' /etc/apt/apt.conf.d || echo 'No ForceIPv4/6 config found.'" ``` ```bash chmod +x ip6_test.sh ./ip6_test.sh ``` Otherwise we have developed an new ipv6 function in our dev Repo, as default ipv6 for default installs is deactivated: You can use this Script for Testing (default / default verbose / advanced) ```bash bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/debian.sh)" ```
Author
Owner

@mouldybread commented on GitHub (Jun 25, 2025):

Resolved, PEBKAC, sorry for wasting your time and thank you for your help.

Test script showed lack of IPv4 connectivity, container blocked by firewall. Removing block resolves issue - container uses IPv4 and does not complain about IPv6.

I should have caught that, prior issues with Apt and IPv6 coloured my thought process.

@mouldybread commented on GitHub (Jun 25, 2025): Resolved, PEBKAC, sorry for wasting your time and thank you for your help. Test script showed lack of IPv4 connectivity, container blocked by firewall. Removing block resolves issue - container uses IPv4 and does not complain about IPv6. I should have caught that, prior issues with Apt and IPv6 coloured my thought process.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#1348