Disable IPv6 on OpenWrt¶
This guide will disable IPv6 on the standard lan, wan, and wan6 interfaces. It will also disable Router Advertisement (RA), DHCPv6, and NDP relay services on lan. It does not remove IPv6 packages or disable odhcpd globally.
Warning
Before continuing, make sure your internet service does not use IPv6 for DS-Lite, MAP, or 464XLAT. Disabling IPv6 on these connections can also stop IPv4 connectivity.
The commands use the default interface names lan, wan, and wan6. First, check the interface names on your router:
uci show network
uci show dhcp
Disable IPv6 Interfaces and LAN Services¶
OpenWrt documents the ipv6 and disabled options in its UCI networking options. The ra, dhcpv6, and ndp service modes are documented in the odhcpd reference.
Run the following commands:
uci set network.lan.ipv6='0'
uci set network.wan.ipv6='0'
uci set network.wan6.disabled='1'
uci -q delete network.lan.ip6assign
uci -q delete network.globals.ula_prefix
uci set dhcp.lan.ra='disabled'
uci set dhcp.lan.dhcpv6='disabled'
uci set dhcp.lan.ndp='disabled'
uci commit network
uci commit dhcp
service network restart
service odhcpd restart
The OpenWrt IPv6 configuration reference defines ip6assign as the prefix length delegated to an interface. Deleting this option stops prefix assignment to lan. Deleting network.globals.ula_prefix removes the configured Unique Local Address prefix. The three dhcp.lan settings stop IPv6 address and route advertisement services on lan without shutting down odhcpd for every interface.
Verify the Result¶
Run the following commands to check the saved UCI settings, IPv6 addresses, and routes:
uci show network.lan
uci show network.wan
uci show network.wan6
uci show dhcp.lan
ip -6 address show
ip -6 route show
If your router uses different interface names, apply and check the same settings on each LAN and WAN interface.