Disable IPv6 for quicker browsing (in some cases)

Forum rules
Share your brain ;)
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Disable IPv6 for quicker browsing (in some cases)

Unread post by machinebacon » Thu Jun 05, 2014 8:36 am

Most of you know it, but those who don't, here it goes:

IPv6, if not supported by your ISP, can make browsing painstakingly slow.

Method 1 - if your PC definitely boots with sysctl turned on (usually it does)

To disable IPv6 on your PC, first edit systctl.conf as root:

Code: Select all

sudo nano /etc/sysctl.conf
and add these lines

Code: Select all

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
remove or comment all IPv6-related entries in the host file (thanks Alad for the pointer). They have something with 'ip6' in the line. Put a # in front.

Code: Select all

sudo nano /etc/hosts
As next, either reboot, or run

Code: Select all

sudo sysctl -p

Method 2 - Editing the GRUB to disable IPv6 before sysctl would kick in

Code: Select all

sudo nano /etc/default/grub
search for the kernel boot line starting with GRUB_CMDLINE_LINUX_DEFAULT

and add or append

Code: Select all

ipv6.disable=1
between the quotes.

Save and exit, then run

Code: Select all

sudo update-grub && sudo reboot
That's all about it. Good luck ;)
..gnutella..

User avatar
Alad
should take a shower
Posts: 447
Joined: Wed May 21, 2014 12:52 am

Re: Disable IPv6 for quicker browsing (in some cases)

Unread post by Alad » Thu Jun 05, 2014 8:53 am

+1

Alternative way:

Append ipv6.disable=1 to /etc/default/grub, then sudo update-grub. With the sysctl method you may also want to comment out any ipv6 addresses in /etc/hosts
It's funny how we used to be able to do real stuff with rudimentary computers, but now we can't. -- ratcheer

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Disable IPv6 for quicker browsing (in some cases)

Unread post by machinebacon » Thu Jun 05, 2014 9:11 am

Ah of course, I add this! Thanks

The thing about GRUB, of course - it is not only an alternative way, but maybe the only way if sysctl is not loaded at boot-time at all. I'll merge your comment :)
..gnutella..

Post Reply