mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-20 12:35:16 +00:00
force disable IPv6 if IPV6_METHOD = none (#9277)
* Enhance IPv6 disabling logic in install script Updated verb_ip6 to check both IPV6_METHOD and DISABLEIPV6 variables. Added disabling for all, default, and loopback interfaces, improved messaging, and redirected sysctl output to /dev/null for cleaner logs. * Improve IPv6 disabling logic in install scripts Updated both alpine-install.func and install.func to enhance IPv6 disabling by checking IPV6_METHOD and adding more sysctl settings. Also improved messaging and removed suppression of sysctl output in install.func.
This commit is contained in:
@@ -13,10 +13,16 @@ load_functions
|
|||||||
verb_ip6() {
|
verb_ip6() {
|
||||||
set_std_mode # Set STD mode based on VERBOSE
|
set_std_mode # Set STD mode based on VERBOSE
|
||||||
|
|
||||||
if [ "$DISABLEIPV6" == "yes" ]; then
|
if [ "$IPV6_METHOD" == "none" ] || [ "$DISABLEIPV6" == "yes" ]; then
|
||||||
|
msg_info "Disabling IPv6"
|
||||||
$STD sysctl -w net.ipv6.conf.all.disable_ipv6=1
|
$STD sysctl -w net.ipv6.conf.all.disable_ipv6=1
|
||||||
|
$STD sysctl -w net.ipv6.conf.default.disable_ipv6=1
|
||||||
|
$STD sysctl -w net.ipv6.conf.lo.disable_ipv6=1
|
||||||
echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf
|
echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf
|
||||||
|
echo "net.ipv6.conf.default.disable_ipv6 = 1" >>/etc/sysctl.conf
|
||||||
|
echo "net.ipv6.conf.lo.disable_ipv6 = 1" >>/etc/sysctl.conf
|
||||||
$STD rc-update add sysctl default
|
$STD rc-update add sysctl default
|
||||||
|
msg_ok "Disabled IPv6"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,13 @@ load_functions
|
|||||||
verb_ip6() {
|
verb_ip6() {
|
||||||
set_std_mode # Set STD mode based on VERBOSE
|
set_std_mode # Set STD mode based on VERBOSE
|
||||||
|
|
||||||
if [ "$DISABLEIPV6" == "yes" ]; then
|
if [ "$IPV6_METHOD" == "none" ] || [ "$DISABLEIPV6" == "yes" ]; then
|
||||||
echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf
|
msg_info "Disabling IPv6"
|
||||||
|
$STD echo "net.ipv6.conf.all.disable_ipv6 = 1" >>/etc/sysctl.conf
|
||||||
|
$STD echo "net.ipv6.conf.default.disable_ipv6 = 1" >>/etc/sysctl.conf
|
||||||
|
$STD echo "net.ipv6.conf.lo.disable_ipv6 = 1" >>/etc/sysctl.conf
|
||||||
$STD sysctl -p
|
$STD sysctl -p
|
||||||
|
msg_ok "Disabled IPv6"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user