Skip to content

Disable IP v6 on Mint/Ubuntu

This documentation is based on Mint, UBuntu and raspbian recommendation to disable IPv6. But be aware than depending of your local configuration you might need to have IPv6 enabled.

Check state of Ipv6 state

ifconfig | grep inet6
sysctl net.ipv6.conf.all.disable_ipv6 ; sysctl net.ipv6.conf.default.disable_ipv6 ; sysctl net.ipv6.conf.lo.disable_ipv6

net.ipv6.conf.all.disable_ipv6 = 0 net.ipv6.conf.default.disable_ipv6 = 0 net.ipv6.conf.lo.disable_ipv6 = 0

Note that the variables control disabling of ipv6. So setting them to 1 would disable ipv6.

Disable IPv6

Edit the file - /etc/sysctl.conf

sudo vi /etc/sysctl.conf

And fill in the following lines at the end of that file

# IPv6 disabled
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Save the file and close it. Restart sysctl with

sudo sysctl -p

Check the output of ifconfig again and there should be no ipv6 address

ifconfig | grep inet6


Disable Ipv6 on Ubuntu/