I have used the following commands in sysctl.conf to disable IPv6:
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
Running sysctl -p correctly activates these changes on both local and eth0.
However, if I reboot the system, eth0 is assigned an inet6 address according to ifconfig.
eth0 also gets an inet6 address if I disconnect and then re-connect the network cable after running sysctl -p.
I assume there’s some switch that’s overriding my settings when eth0 comes up. Any help pointing me in the right direction would be gratefully received.
I’m not surprised that doesn’t work, because we use connman as our network manager, so it will just override those manual settings.
To disable ipv6 on Ethernet you would use connmanctl:
osmc@rpi2:~$ connmanctl
connmanctl> services
*Ac Wired ethernet_b827ebd04564_cable
connmanctl> config ethernet_b827ebd04564_cable --ipv6 off
connmanctl> quit
This change is persistent. Configuring the network interfaces from the command line is all done via connmanctl - type help while you’re in there and you’ll see there is a lot that can be done.
Tip - rather than typing out the full ethernet string just type e and hit tab…
1 Like
Thanks for the help. That works a treat!
Just a note - we now disable IPv6 by default, but you can use the above steps but with auto instead of off if you wish to turn IPv6 back on for a given interface.