April 23, 2018

How to disable IPv6 in Ubuntu

1. # vi /etc/sysctl.conf : Add the followings and save.
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
net.ipv6.conf.eth0.disable_ipv6=1

2. # sysctl -p : Apply sysctl.conf.

3. # vi /etc/default/grub : Add the new one line.


GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="initrd=/install/gtk/initrd.gz" → Find these two lines.
GRUB_CMDLINE_LINUX="ipv6.disable=1" → Add this line.


4. # update-grub2
5. # sync
6. # reboot