How to switch off IPv6 on RPi3?
I have seen that my Pi creates sockets on IPv6, which makes no sense since it is not in an environment where this protocol is in use (home network using IPv4).
Seems like a waste of space and capacity.
How can I disable IPv6?
Running Raspbian Jessie 2016-02-26
Seems like a waste of space and capacity.
How can I disable IPv6?
Running Raspbian Jessie 2016-02-26
Bo Berglund
Sweden
Sweden
- DougieLawson
- Posts: 42312
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: How to switch off IPv6 on RPi3?
Raspbian has IPv6 switched off by default. I have to update /etc/modprobe.d/ipv6.conf to get IPv6 working.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: How to switch off IPv6 on RPi3?
Strange,
I made a clean install from the Jessie image on a Pi3 and then when I use netstat I get this response:
As you can see there are 4 open TCP ports on IPv6....
I made a clean install from the Jessie image on a Pi3 and then when I use netstat I get this response:
Code: Select all
pi@rpi3-jessie:~ $ netstat -lnpt
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:2947 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 662/Xtightvnc
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 662/Xtightvnc
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN -
tcp6 0 0 :::2947 :::* LISTEN -
tcp6 0 0 :::139 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 :::445 :::* LISTEN -
Bo Berglund
Sweden
Sweden
- DougieLawson
- Posts: 42312
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: How to switch off IPv6 on RPi3?
Try adding to /etc/modprobe.d/ipv6.conf
Code: Select all
blacklist ipv6
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: How to switch off IPv6 on RPi3?
My /etc/modprobe.d/ipv6.conf file contains the following:
If I un-commented the last line wouldn't that have the effect of not starting IPv6?
Blacklist sounds like a strange way to control hardware interfaces, are you sure about that?
Code: Select all
# Don't load ipv6 by default
alias net-pf-10 off
#alias ipv6 off
Blacklist sounds like a strange way to control hardware interfaces, are you sure about that?
Bo Berglund
Sweden
Sweden
- DougieLawson
- Posts: 42312
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: How to switch off IPv6 on RPi3?
Just add it to your file and reboot.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: How to switch off IPv6 on RPi3?
Didn't work...DougieLawson wrote:Just add it to your file and reboot.
Code: Select all
pi@rpi3-jessie:~ $ 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:2947 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 662/Xtightvnc
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 662/Xtightvnc
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN -
tcp6 0 0 :::2947 :::* LISTEN -
tcp6 0 0 :::139 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 :::445 :::* LISTEN -
Code: Select all
pi@rpi3-jessie:~ $ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:e2:6b:1f
inet addr:192.168.0.148 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::1aa3:82a1:acdd:d00d/64 Scope:Link
Bo Berglund
Sweden
Sweden
Re: How to switch off IPv6 on RPi3?
Maybe it's changed Dougie. My PI3 here has ipv6 enabled by default.DougieLawson wrote:Raspbian has IPv6 switched off by default. I have to update /etc/modprobe.d/ipv6.conf to get IPv6 working.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: How to switch off IPv6 on RPi3?
So does my Jessie Pi 1 B+PeterO wrote:My PI3 here has ipv6 enabled by default.
Re: How to switch off IPv6 on RPi3?
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:
But netstat still shows it
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)
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 -
- DougieLawson
- Posts: 42312
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: How to switch off IPv6 on RPi3?
I have IPv6 enabled on my network, on my Ubuntu system I have to remove the IPv6 blacklist to enable it. It may be that the RPF kernel now has IPv6 built in rather than as a loadable module.
Go and read the kernel config and the kernel docs to see how it's built.
It very easy to get IPv6 running with a Hurricane Electric tunnel http://tunnelbroker.net
Go and read the kernel config and the kernel docs to see how it's built.
It very easy to get IPv6 running with a Hurricane Electric tunnel http://tunnelbroker.net
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: How to switch off IPv6 on RPi3?
Yes, it is built into the kernel, not as a module.
To disable it completely just add this to /boot/cmdline.txt
To disable it completely just add this to /boot/cmdline.txt
Code: Select all
ipv6.disable=1
Re: How to switch off IPv6 on RPi3?
Now IPv6 is again a module by this commit 18 day ago: https://github.com/raspberrypi/linux/co ... 2e1b988919Rascas wrote:Yes, it is built into the kernel, not as a module.
To disable it completely just add this to /boot/cmdline.txtCode: Select all
ipv6.disable=1
I did a add iv6.disable=1 to cmdline.txt and it works, no more IPv6 stuff in dmesg. So I try
Code: Select all
pi@raspberrypi:~ $ lsmod
Module Size Used by
bcm2835_gpiomem 3040 0
bcm2835_wdt 3225 0
uio_pdrv_genirq 3164 0
uio 8000 1 uio_pdrv_genirq
i2c_dev 5859 0
fuse 83461 1
ipv6 347530 0
Code: Select all
pi@raspberrypi:~ $ sudo modprobe -r ipv6
modprobe: ERROR: ../libkmod/libkmod-module.c:777 kmod_module_remove_module() could not remove 'ipv6': Device or resource busy
What's wrong here or what do I not understand?
Re: How to switch off IPv6 on RPi3?
Which kernel / firmware version do you run on (use 'uname -a')?Gerd wrote:What's wrong here or what do I not understand?
Re: How to switch off IPv6 on RPi3?
Code: Select all
pi@raspberrypi:~ $ uname -a && vcgencmd version
Linux raspberrypi 4.4.8-v7+ #880 SMP Fri Apr 22 21:55:04 BST 2016 armv7l GNU/Linux
Apr 27 2016 11:06:18
Copyright (c) 2012 Broadcom
version 9b52ab7b475f4a056658fd2d95d2440b32167390 (clean) (release)
Re: How to switch off IPv6 on RPi3?
Try with:Gerd wrote: I did a add iv6.disable=1 to cmdline.txt and it works, no more IPv6 stuff in dmesg. So I try
Code: Select all
# Don't load ipv6 by default
alias net-pf-10 off
alias ipv6 off
options ipv6 disable_ipv6=1
Code: Select all
:~ $ modinfo ipv6 | grep -i parm
parm: disable:Disable IPv6 module such that it is non-functional (int)
parm: disable_ipv6:Disable IPv6 on all interfaces (int)
parm: autoconf:Enable IPv6 address autoconfiguration on all interfaces (int)
Re: How to switch off IPv6 on RPi3?
no error no more after reboot, but:
Seems like IPv6 is here to stay.
Code: Select all
pi@raspberrypi:~ $ cat /etc/modprobe.d/ipv6.conf
# Don't load ipv6 by default
alias net-pf-10 off
#uncommented by Gerd: alias ipv6 off
alias ipv6 off
#added by Gerd: options ipv6 disable_ipv6=1
options ipv6 disable_ipv6=1
#see https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=138899&p=964851#p964851
pi@raspberrypi:~ $ lsmod
Module Size Used by
bcm2835_gpiomem 3040 0
bcm2835_wdt 3225 0
uio_pdrv_genirq 3164 0
uio 8000 1 uio_pdrv_genirq
i2c_dev 5859 0
fuse 83461 1
ipv6 347530 0
pi@raspberrypi:~ $ sudo modprobe -r ipv6
pi@raspberrypi:~ $ lsmod
Module Size Used by
bcm2835_gpiomem 3040 0
bcm2835_wdt 3225 0
uio_pdrv_genirq 3164 0
uio 8000 1 uio_pdrv_genirq
i2c_dev 5859 0
fuse 83461 1
ipv6 347530 0
Re: How to switch off IPv6 on RPi3?
Seems to be 'normal'.Gerd wrote:Seems like IPv6 is here to stay.
I see the same and I have seen another user having the same issue: module is still loaded for some reason.
- DougieLawson
- Posts: 42312
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: How to switch off IPv6 on RPi3?
Why not embrace the IPv6 (20 years old) protocol rather than dismissing it as something you don't need?
I've been running a IPv4 to IPv6 tunnel for many years, my current tunnel is done with Hurricane Electric and gives every IPv6 ready device in my network a 2001:xxxx:xxxx:xxxx/64 prefixed IPv6 address.
It's extremely simple to set up. https://tunnelbroker.net/
I've been running a IPv4 to IPv6 tunnel for many years, my current tunnel is done with Hurricane Electric and gives every IPv6 ready device in my network a 2001:xxxx:xxxx:xxxx/64 prefixed IPv6 address.
It's extremely simple to set up. https://tunnelbroker.net/
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: How to switch off IPv6 on RPi3?
I took your advice and reverted all changes. I'll be better off investing time to learn more about IPv6.DougieLawson wrote:Why not embrace the IPv6 (20 years old) protocol rather than dismissing it as something you don't need?
Thank you for pointing me in the right direction!

-
- Posts: 5
- Joined: Sat Oct 31, 2015 8:04 pm
Re: How to switch off IPv6 on RPi3?
Because, I don't need IPv6 on a System, that will only will be connecte within my local Netzwork.DougieLawson wrote:
Why not embrace the IPv6 (20 years old) protocol rather than dismissing it as something you don't need?
And because
* IPv6 is still a Problem on nearly all Home-Routers.
* it is my decision which IP address which system in my network gets.
Since concept of IPv6 is, in my opinion, a failure.
It wants to regulate too much automatically, which should not be automatically regulated.
Unfortunately, there is no alternative.
Re: How to switch off IPv6 on RPi3?
Add these lines to /etc/sysctl.conf
Save and close.
Activate with: (or reboot)
Done
Code: Select all
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
net.ipv6.conf.[interface].disable_ipv6 = 1
Activate with:
Code: Select all
sysctl -p
Done

Re: How to switch off IPv6 on RPi3?
BSmallz » Sun Jan 15, 2017 4:03 pm : it works, thx.
Re: How to switch off IPv6 on RPi3?
I try this fix but when i insert the sysctl -p command it says:
Why?
If i try ifconfig now it says:
It's ok or there are some problems?
Thanks
Code: Select all
root@raspberryMMDVM:~# clear
root@raspberryMMDVM:~# history -c
root@raspberryMMDVM:~# sysctl -p
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
sysctl: cannot stat /proc/sys/net/ipv6/conf/[interface]/disable_ipv6: File o directory non esistente
If i try ifconfig now it says:
Code: Select all
root@raspberryMMDVM:~# ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:21:c2:de
inet addr:192.168.1.80 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:500 errors:0 dropped:30 overruns:0 frame:0
TX packets:239 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80950 (79.0 KiB) TX bytes:51895 (50.6 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr b8:27:eb:74:97:8b
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Thanks
Re: How to switch off IPv6 on RPi3?
My solution. IPv6 disabled. ipv6 module not loaded.
I just want a clean ipv4 system.
Add ipv6.disable=1 to cmdline.txt.
I just want a clean ipv4 system.
Add ipv6.disable=1 to cmdline.txt.
Code: Select all
cat /etc/modprobe.d/ipv6.conf
# Don't load ipv6 by default
alias net-pf-10 off
# uncommented
alias ipv6 off
# added
options ipv6 disable_ipv6=1
# this is needed for not loading ipv6 driver
blacklist ipv6
Building memories...