Manage cookies that are used for advertising, such as ad personalization, remarketing, and ad effectiveness analysis.
5.3.10. Disabling IPv6 on VPS
In Linux-like operating systems, you can disable IPv6 both for all interfaces and for a specific one. There are generic methods that can be applied to all operating systems.
For all interfaces
- Go to the directory
/etc/sysctl.d/:cd /etc/sysctl.d/
- Add to file
99-sysctl.confthe necessary parameters to disable IPv6 in any of the following ways:- Or edit the file manually using some editor:
vi 99-sysctl.conf
Add the following lines to the end of the file:
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1
- Or run the command to insert the required lines at the end of the file:
printf "\n net.ipv6.conf.all.disable_ipv6 = 1 \n net.ipv6.conf.default.disable_ipv6 = 1" >> 99-sysctl.conf
- Apply changes:
sysctl -p - Check if IPv6 is configured on the server:
ifconfig
For a specific interface
- Determine which interface needs to disable IPv6. You can display a list of all interfaces with the command:
ifconfigThe command output will look something like this:
For example, the desired interface will be called eth0. - Go to the directory
/etc/sysctl.d/:cd /etc/sysctl.d/
- Add to file
99-sysctl.confthe necessary parameters to disable IPv6 in any of the following ways:- Or edit the file manually using some editor:
vi 99-sysctl.conf
Add the line to the end of the file:
net.ipv6.conf.eth0.disable_ipv6 = 1
Instead
eth0specify the desired interface. - Or run the command to insert the required lines at the end of the file:
printf "\n net.ipv6.conf.eth0.disable_ipv6 = 1" >> 99-sysctl.conf
Instead
eth0specify the desired interface.
- Apply changes:
sysctl -p - Check if IPv6 is configured on the server:
ifconfig