User avatar
carriba
Posts: 188
Joined: Tue Nov 18, 2014 5:55 pm

Re: How to switch off IPv6 on RPi3?

Tue Apr 18, 2017 6:22 pm

Thank you all for the suggestions provided, and indeed it helps to disable IPv6 completely and remove the module from memory as follows:

Contents of the /etc/modprobe.d/ipv6.conf configuration file:

Code: Select all

alias net-pf-10 off
alias ipv6 off
options ipv6 disable_ipv6=1
blacklist ipv6
After a reboot, firing the command "lsmod" shall show no line entry denoting to "ipv6.", and the same shall also be for the command "ifconfig".

Optionally and if required, add in /boot/cmdtline.txt the parameter:

Code: Select all

ipv6.disable=1
It works also for the latest April 2017 Raspbian image with kernel version 4.9.22-v7+.

DavidS.
Posts: 1
Joined: Sun Aug 20, 2017 9:31 pm

Re: How to switch off IPv6 on RPi3?

Sun Aug 20, 2017 9:41 pm

Hiho.
I have some questions about this topic. I want to work with ipv6 on my pi.

Code: Select all

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:8123            0.0.0.0:*               LISTEN      -
tcp6       0      0 :::80                   :::*                    LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -
tcp6       0      0 ::1:6010                :::*                    LISTEN      -
Whats the meaning of the numbers 80, 22 and 6010 ?

Martin Frezman
Posts: 1009
Joined: Mon Oct 31, 2016 10:05 am

Re: How to switch off IPv6 on RPi3?

Mon Aug 21, 2017 12:10 am

Whats the meaning of the numbers 80, 22 and 6010 ?
They are port numbers of existing connections that you have to your Pi.

80 is HTTP (web)
22 is ssh (terminal)
6010 is X windows - display 10 - which is generally connected with an ssh connection (with the -X or -Y command line option).
If this post appears in the wrong forums category, my apologies.

lilbran
Posts: 1
Joined: Fri Aug 25, 2017 1:00 pm

Re: How to switch off IPv6 on RPi3?

Fri Aug 25, 2017 1:01 pm

Rascas wrote:
Tue Mar 08, 2016 9:03 am
Yes, it is built into the kernel, not as a module.

To disable it completely just add this to /boot/cmdline.txt

Code: Select all

ipv6.disable=1
Worked perfectly and was finally able to get my RPi to update! Thank you!! :D

Tomo2k
Posts: 127
Joined: Mon Dec 19, 2011 10:00 pm

Re: How to switch off IPv6 on RPi3?

Sat Nov 11, 2017 12:11 am

Excellent, thanks.

As to "Why disable IPv6?"

apt-get seems to prefer IPv6 mirrors if they are listed.

My ISP doesn't support IPv6, so I can't get to any of those mirrors, and thus apt-get upgrade fails.
Disabling IPv6 appears to force apt to pick an IPv4 mirror.

It'd be lovely if my ISP could add support for IPv6, however the majority of UK ISPs don't and it's clearly going to be a long time before they do.
My guess is that they have a large installed base of ancient routers that they can't upgrade, and don't want to spend the money replacing.

User avatar
rpdom
Posts: 21828
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to switch off IPv6 on RPi3?

Sat Nov 11, 2017 5:22 am

This page is also relevant for Raspbian, even though it says it is for Ubuntu. It gives a method of disabling IPv6 for just apt or for the whole system. It doesn't require changes to cmdline.txt.

ignazioc
Posts: 6
Joined: Fri Aug 25, 2017 6:32 am

Re: How to switch off IPv6 on RPi3?

Sat Feb 10, 2018 10:34 pm

This post helped me a lot.
I had to disable IPV6 on my raspberryPI because `apt-get update` was not working properly, blocked always to 0%

Can someone explains me the reason why?

mk6032
Posts: 2
Joined: Wed Sep 30, 2015 3:41 pm

Re: How to switch off IPv6 on RPi3?

Thu Feb 07, 2019 6:10 pm

JimmyN wrote:
Mon Mar 07, 2016 9:12 pm
I turned it off using "/etc/sysctl.conf", by adding the line "net.ipv6.conf.all.disable_ipv6 = 1"

That resulted in no ipv6 address:

Code: Select all

eth0      Link encap:Ethernet  HWaddr b8:27:eb:4f:95:d6
          inet addr:192.168.0.6  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:75072 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4621 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4554883 (4.3 MiB)  TX bytes:801499 (782.7 KiB)
But netstat still shows it

Code: Select all

>$ netstat -lnpt
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -
Some daemons will listen to ipv6 by default. In your example there its sshd. NTP, named, etc. may also listen on ipv6 by default, and you may need to edit the appropriate /etc/default/ file to change the start options for the daemon (e.g. -4 option for sshd).

Return to “Networking and servers”