1

I have 3 rpis on my network and only one of them has decided it needs to use ipv6.

I have been able to set it to ipv4 using the sudo dhclient -4 -v wlan0 command I tried setting the disable ipv6 on the settings in the x server but it had no effect.

I also tried to add the net.ipv6.conf.all.disable_ipv6=1 into the /etc/sysctl.conf and this made no difference either.

why is this only an issue on this one ?

1
  • 1
    I would question what you have done to this one :-) Mine swap between IPv4 and IPv6 when I ssh in and I've given up bothering why. I now normally add ipv6.disable=1 to cmdline.txt but see my samba note raspberrypi.org/forums/viewtopic.php?p=1482683
    – user115418
    May 16 '20 at 16:44
2

This might help:

$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.184  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::307:7d3d:9c3b:ba10  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:20:0f:59  txqueuelen 1000  (Ethernet)
        RX packets 1003704  bytes 148211270 (141.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 72126  bytes 9574869 (9.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Note first that I don't use WiFi (Ethernet only for this Pi), and also the line in the output beginning with inet6. If you use WiFi, there may be a similar line for that interface.

Now, do this:

sudo nano /etc/sysctl.conf

If you don't like nano, then feel free to use another editor. The important points are:

  • /etc/sysctl.conf must be edited
  • root privileges are required

Add the following line to /etc/sysctl.conf:

net.ipv6.conf.all.disable_ipv6 = 1

You may notice that all of the lines in /etc/sysctl.conf are commented (# ) - that was the case on my RPi. This line is not to be commented.

Save /etc/sysctl.conf, and close the editor. Then, either reboot, -OR- do this:

sudo sysctl -p

If you execute this command, AND you happen to be connected to your RPi over an IPv6 connection, you will not get an immediate reply to this command. Eventually, you may see something like this as I did) signaling your connection is broken, and needs to be re-established:

packet_write_wait: Connection to fe80::307:7d3d:9c3b:ba10%en0 port 22: Broken pipe

Simply re-establish your SSH connection (if that's what you're using), and run ifconfig again:

ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.184  netmask 255.255.255.0  broadcast 192.168.1.255
        ether dc:a6:32:02:f0:95  txqueuelen 1000  (Ethernet)
        RX packets 1013114  bytes 149500440 (142.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 72891  bytes 9673203 (9.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Note that inet6 is no longer listed. If your RPi is still using IPv6, please let us know how you have concluded that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.