Disable ipv6

From Wasya Wiki
Jump to: navigation, search

From: https://itsfoss.com/disable-ipv6-ubuntu-linux/

You have see the sysctl command in the tutorial about restarting network in Ubuntu. We are going to use it here as well. To disable IPv6 you only have to input 3 commands:


sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

You can check if it worked using:

 ip a

You should see no IPv6 entry.

One method to make this option persist is modifying /etc/sysctl.conf

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

For the settings to take effect use:

 sudo sysctl -p

Trash

If IPv6 is still enabled after rebooting, you must create (with root privileges) the file /etc/rc.local and fill it with:

#!/bin/bash
# /etc/rc.local

/etc/sysctl.d
/etc/init.d/procps restart

exit 0
 sudo chmod 755 /etc/rc.local