
1. Edit the file - /etc/sysctl.conf
$ sudo gedit /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
2. Save the file and close it
3. Restart sysctl with
$ sudo sysctl -p
4. Check the output of ifconfig again and there should be no ipv6 address
$ ifconfig eth0 Link encap:Ethernet HWaddr 08:00:27:5f:28:8b inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1346 errors:0 dropped:0 overruns:0 frame:0 TX packets:965 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1501691 (1.5 MB) TX bytes:104883 (104.8 KB)
If it does not work, then try rebooting the system and check ifconfig again.
Disable ipv6 - GRUB method
1. Ipv6 can also be disabled by editing the grub configuration file
$ sudo gedit /etc/default/grub
2. Look for the line containing "GRUB_CMDLINE_LINUX" and edit it as follows
GRUB_CMDLINE_LINUX="ipv6.disable=1"
The same can also be added to the value of the variable named "GRUB_CMDLINE_LINUX_DEFAULT" and either would work. Save the file, close it and regenerate the grub configuration
$ sudo update-grub2
3. Reboot. Now ipv6 should be disabled.
ที่มา : http://www.binarytides.com/disable-ipv6-ubuntu/