This topic describes why the 'error: "net.ipv6.conf.all.disable_ipv6" is an unknown key' error occurs when you run the sysctl -p command on a Linux ECS instance and provides solutions.
Symptoms
When you run the sysctl -p command on a Linux ECS instance, the following error message appears.
error: "net.ipv6.conf.all.disable_ipv6" is an unknown keyCauses
This error may occur for the following reasons:
The IPv6 feature is disabled, but the related parameter settings are not deleted from or commented out in the
sysctl.confkernel parameter file of the ECS instance.The IPv6 feature is enabled, but the related parameter settings are not enabled in the
sysctl.confkernel parameter file, or the IPv6 module is missing.
Solution
To resolve this issue, modify the sysctl.conf kernel parameter configuration file.
Connect to the ECS instance remotely.
For more information, see Connection methods overview.
Modify the
sysctl.confkernel parameter configuration file.Disable IPv6.
Run the following command to open and edit the
sysctl.confkernel parameter configuration file.vim /etc/sysctl.confPress
ito enter edit mode.Add a number sign (
#) before the IPv6 parameter to comment it out, or delete the parameter setting.#net.ipv6.conf.all.disable_ipv6 = 1Press the
Esckey and enter:wqto save the changes and exit edit mode.
Enable IPv6.
Run the following command to open and edit the
sysctl.confkernel parameter configuration file.vim /etc/sysctl.confPress
ito enter edit mode.Modify the kernel parameter to enable the IPv6 configuration.
net.ipv6.conf.all.disable_ipv6 = 0Press the
Esckey and enter:wqto save the changes and exit edit mode.Run the following command to load the IPv6 module.
modprobe ipv6
Run the
sysctl -pcommand again. The issue is resolved if no error message appears.