Verify @Vgaetera commands to disable ipv6

@vgaetera

https://forum.openwrt.org/t/how-to-disable-ipv6-on-the-router/84534

in the link above, gave some commands to disable ipv6 and I wanted to be sure before trying. I hope it will solve my problem further down. Here are the commands:

uci set 'network.lan.ipv6=0'
uci set 'network.wan.ipv6=0'
uci set 'dhcp.lan.dhcpv6=disabled'
/etc/init.d/odhcpd disable
uci commit

uci -q delete dhcp.lan.dhcpv6
uci -q delete dhcp.lan.ra
uci commit dhcp
/etc/init.d/odhcpd restart

uci set network.lan.delegate="0"
uci commit network
/etc/init.d/network restart

/etc/init.d/odhcpd disable
/etc/init.d/odhcpd stop

uci -q delete network.globals.ula_prefix
uci commit network
/etc/init.d/network restart

And my syslog has plenty of these and also from time to time I would loose connection. This may not be the problem, but I do not need ipv6. So, first, can someone please confirm those commands working on:
OpenWrt 22.03.2 r19803-9a599fee93 / LuCI openwrt-22.03 branch git-22.361.69894-438c598

A default route is present but there is no public prefix on lan thus we don't announce a default route!

@vgaetera :point_left: tagged him

Easy way around this is to Suppress warnings about missing GUA prefix

Based on a cursory look, it looks fine to me, but it if you want to see what they do, here’s a way to see what uci set and uci delete commands will affect your configs

  • replace each uci set command with uci -q show and delete the =<value?> at EOL. ie. uci set 'network.lan.ipv6=0' to uci -q show ‘network.lan.ipv6’
  • replace each uci delete -q command to uci -q show

Within the context of the recipe provided, run each uci set and uci -q delete command on its own. This will indicate

  • what values (if they exist in your configs), and what might be changed to your configs.
  • what entries (if they exist in your configs), and what might be deleted in your configs.

If you choose to follow the recipe, take a backup to restore if you’re not happy with the results.

Disabling IPv6 nowadays should be your last resort, as it can do more harm than good.
If you don't have public prefix, suppress log spamming and try IPv6 masquerading.

3 Likes