Merge pull request #34 from community-scripts/ipv6

Enable IPV6 config.
This commit is contained in:
Michel Roegl-Brunner 2025-03-11 16:10:34 +01:00 committed by GitHub
commit aea3fb28c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,7 @@
# Author: tteck (tteckster)
# Co-Author: MickLesk
# Co-Author: michelroegl-brunner
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
variables() {
NSAPP=$(echo ${APP,,} | tr -d ' ') # This function sets the NSAPP variable by converting the value of the APP variable to lowercase and removing any spaces.
@ -333,6 +333,7 @@ base_settings() {
HN=$NSAPP
BRG="vmbr0"
NET="dhcp"
IPv6="auto"
GATE=""
APT_CACHER=""
APT_CACHER_IP=""
@ -711,7 +712,25 @@ advanced_settings() {
if (whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "IPv6" --yesno "Disable IPv6?" 10 58); then
DISABLEIP6="yes"
else
IPv6="auto"
DISABLEIP6="no"
if IP6=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "IPv6" --inputbox "Enter IPv6 Address (Default SLAAC)" 10 58); then
IPv6=$IP6
echo -e "${NETWORK}${BOLD}${DGN}IPv6 Address: ${BGN}$IPv6${CL}"
if IP6GW=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Enter IPv6 Gateway" 8 58 --title "IPv6 Gateway" 3>&1 1>&2 2>&3); then
if [ -z $IP6GW ]; then
IP6GW="Default"
echo -e "${GATEWAY}${BOLD}${DGN}IPv6 Gateway: ${BGN}$IP6GW${CL}"
else
IPv6GW=",gw6=$IP6GW"
echo -e "${GATEWAY}${BOLD}${DGN}IPv6 Gateway: ${BGN}$IP6GW${CL}"
fi
else
exit_script
fi
else
IPv6="auto"
fi
fi
echo -e "${DISABLEIPV6}${BOLD}${DGN}Disable IPv6: ${BGN}$DISABLEIP6${CL}"
@ -837,9 +856,9 @@ diagnostics_check() {
DIAGNOSTICS=yes
#This file is used to store the diagnostics settings for the Community-Scripts API.
#https://github.com/community-scripts/ProxmoxVED/discussions/1836
#https://github.com/community-scripts/ProxmoxVE/discussions/1836
#Your diagnostics will be sent to the Community-Scripts API for troubleshooting/statistical purposes.
#You can review the data at https://community-scripts.github.io/ProxmoxVED/data
#You can review the data at https://community-scripts.github.io/ProxmoxVE/data
#If you do not wish to send diagnostics, please set the variable 'DIAGNOSTICS' to "no" in /usr/local/community-scripts/diagnostics, or use the menue.
#This will disable the diagnostics feature.
#To send diagnostics, set the variable 'DIAGNOSTICS' to "yes" in /usr/local/community-scripts/diagnostics, or use the menue.
@ -864,9 +883,9 @@ EOF
DIAGNOSTICS=no
#This file is used to store the diagnostics settings for the Community-Scripts API.
#https://github.com/community-scripts/ProxmoxVED/discussions/1836
#https://github.com/community-scripts/ProxmoxVE/discussions/1836
#Your diagnostics will be sent to the Community-Scripts API for troubleshooting/statistical purposes.
#You can review the data at https://community-scripts.github.io/ProxmoxVED/data
#You can review the data at https://community-scripts.github.io/ProxmoxVE/data
#If you do not wish to send diagnostics, please set the variable 'DIAGNOSTICS' to "no" in /usr/local/community-scripts/diagnostics, or use the menue.
#This will disable the diagnostics feature.
#To send diagnostics, set the variable 'DIAGNOSTICS' to "yes" in /usr/local/community-scripts/diagnostics, or use the menue.
@ -1102,6 +1121,8 @@ build_container() {
export PCT_OSTYPE="$var_os"
export PCT_OSVERSION="$var_version"
export PCT_DISK_SIZE="$DISK_SIZE"
export IPv6="$IPv6"
if [[ DISABLEIP6 == "yes" ]]; then
export PCT_OPTIONS="
-features $FEATURES
-hostname $HN
@ -1115,6 +1136,22 @@ build_container() {
-unprivileged $CT_TYPE
$PW
"
else
export PCT_OPTIONS="
-features $FEATURES
-hostname $HN
-tags $TAGS
$SD
$NS
-net0 name=eth0,bridge=$BRG$MAC,ip=$NET$GATE$VLAN$MTU,ip6=$IPv6$IPv6GW
-onboot 1
-cores $CORE_COUNT
-memory $RAM_SIZE
-unprivileged $CT_TYPE
$PW
"
fi
# This executes create_lxc.sh and creates the container and .conf file
bash -c "$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/create_lxc.sh)" || exit $?
@ -1204,7 +1241,7 @@ description() {
<span style='margin: 0 10px;'>
<i class="fa fa-github fa-fw" style="color: #f5f5f5;"></i>
<a href='https://github.com/community-scripts/ProxmoxVE' target='_blank' rel='noopener noreferrer' style='text-decoration: none; color: #00617f;'>GitHub</a>
<a href='https://github.com/community-scripts/ProxmoxVED' target='_blank' rel='noopener noreferrer' style='text-decoration: none; color: #00617f;'>GitHub</a>
</span>
<span style='margin: 0 10px;'>
<i class="fa fa-comments fa-fw" style="color: #f5f5f5;"></i>