Disable IPv6 on Debian installations and LXC containers
On LXC containers, you may also need to disable IPv6 at the host/container configuration level depending on your hypervisor, in Proxmox, uncheck the IPv6 DHCP/SLAAC option on the container’s network interface.
- Create the sysctl configuration file:
sudo touch /etc/sysctl.d/99-disable-ipv6.conf - Add the following:
sudo vi /etc/sysctl.d/99-disable-ipv6.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1- Apply the changes:
sudo sysctl --systemVerify IPv6 is disabled:ip -6 addr, if the output is empty, IPv6 has been successfully disabled
Re-enable IPv6
- Remove the configuration file
/rm /etc/sysctl.d/99-disable-ipv6.conf - Apply the changes:
sudo sysctl --system