Skip to main content

Ubuntu server disable IPv6

IPv6 differs from IPv4 by offering a greater range of available IP addresses. IPv6 is a 128 bit address while IPv4 is a 32 bit address.

There are various reasons not to use IPv6 especially in a server. To disable IPv6 in Ubuntu you will have to override the default kernel parameters. This can be done at runtime as below

Open the sysctl.conf file

vi /etc/sysctl.conf

Set IPv6 as disabled. Add this line

net.ipv6.conf.all.disable_ipv6 = 1

Save the change

:wq

Reload sysctl settings

sysctl -p