22/7
Posts: 44
Joined: Thu Sep 26, 2019 9:07 pm

Moving on

Fri Nov 08, 2019 11:58 am

to another sbc
Last edited by 22/7 on Fri Feb 05, 2021 4:40 am, edited 1 time in total.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Rpi4 disable ipv6

Fri Nov 08, 2019 2:39 pm

My network using an old windows server doesn't like ipv6 to much so I have disabled ipv6 by creating the file /etc/modprobe.d/ipv6.conf and added the line

Code: Select all

blacklist ipv6
Works for a variety of Pis including the Pi4.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

22/7
Posts: 44
Joined: Thu Sep 26, 2019 9:07 pm

moving on

Fri Nov 08, 2019 3:16 pm

moving on
Last edited by 22/7 on Fri Feb 05, 2021 4:41 am, edited 1 time in total.

trejan
Posts: 4739
Joined: Tue Jul 02, 2019 2:28 pm

Re: Rpi4 disable ipv6

Fri Nov 08, 2019 3:49 pm

22/7 wrote:
Fri Nov 08, 2019 3:16 pm
I added

Code: Select all

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
to /etc/rc.local and it did the trick.
You don't need to use sudo as rc.local runs as root anyway.

Whilst changing the sysctl in rc.local does work, it isn't the right place to do it. Create a file called disable-ipv6.conf in /etc/sysctl.d with the contents "net.ipv6.conf.all.disable_ipv6 = 1"

From /etc/sysctl.d/README.sysctl
Kernel system variables configuration files

Files found under the /etc/sysctl.d directory that end with .conf are
parsed within sysctl(8) at boot time. If you want to set kernel variables
you can either edit /etc/sysctl.conf or make a new file.

The filename isn't important, but don't make it a package name as it may clash
with something the package builder needs later. It must end with .conf though.

My personal preference would be for local system settings to go into
/etc/sysctl.d/local.conf but as long as you follow the rules for the names
of the file, anything will work. See sysctl.conf(8) man page for details
of the format.

andrum99
Posts: 1639
Joined: Fri Jul 20, 2012 2:41 pm

Re: Rpi4 disable ipv6

Fri Nov 08, 2019 3:53 pm

Add the following to the end of the single line of text in the file /boot/cmdline.txt:

Code: Select all

ipv6.disable=1
This also has the advantage that you can add it from Windows/OSX before you boot the Pi, since the boot partition is readable under those operating systems.

22/7
Posts: 44
Joined: Thu Sep 26, 2019 9:07 pm

moving on

Fri Nov 08, 2019 5:10 pm

moving on
Last edited by 22/7 on Fri Feb 05, 2021 4:41 am, edited 1 time in total.

trejan
Posts: 4739
Joined: Tue Jul 02, 2019 2:28 pm

Re: Rpi4 disable ipv6

Fri Nov 08, 2019 6:52 pm

22/7 wrote:
Fri Nov 08, 2019 5:10 pm
I like the cmdline.txt option but would that still be considered incorrect compared to trejans suggestion?
Doing it from cmdline.txt is fine.

Return to “Troubleshooting”