IPv6 on OpenWrt has two halves: receiving an address/prefix upstream and distributing a prefix downstream to LAN. I do not treat a single checkbox as a finished configuration; I identify whether the ISP uses native DHCPv6, PPPoE, static addressing, relay, or a tunnel, then test RA, DHCPv6, routes, and source policy.1
Compliance and general features
The default firmware commonly includes odhcp6c as the DHCPv6 client, odhcpd as the RA/DHCPv6 server, and IPv6 firewall support; LuCI needs luci-proto-ipv6. A custom image must include the corresponding packages. The source aims at RFC 7084 but lists known gaps, so I test the actual behavior instead of treating the RFC target as an absolute guarantee.1
The important capabilities are address/prefix/route management, prefix unreachable routes, prefix classes, source-based policy routing, SLAAC, stateless/stateful DHCPv6, DHCPv6-PD, lifetime handling, DAD, MTU detection, and relay/NDP proxying.
Upstream WAN configuration
Native IPv6 connection
For a native upstream, this example uses a dhcpv6 wan6 interface and delegates a /60 to LAN. eth1 is only an example; the real topology may use a VLAN, @wan, or another device.1
| |
For DHCPv6 on WAN, the firewall must allow DHCPv6 replies from UDP port 547 to port 546 as shown by the source:
| |
PPP-based protocols and option ipv6
PPPoE/PPPoA require option ipv6 in the parent wan interface. 0 disables IPv6; 1 enables IPCP6 negotiation but leaves the remaining configuration to a manually configured wan6; auto is the default, creates wan_6, and starts odhcp6c. With auto, LAN needs ip6assign 64 or a larger prefix length to distribute the delegated prefix. I do not add a manual wan6 when the automatically spawned wan_6 already matches the ISP.1
Options for the dhcpv6 protocol
The table keeps the option names and practical meanings from the source because omitting one of these is a common cause of incomplete IPv6 setups:
| Option | Type/value | Default | Practical meaning |
|---|---|---|---|
reqaddress | try, force, none | try | How to request an IPv6 address. |
reqprefix | auto, no, 0-64 | auto | Request a prefix; no asks only for a router address. |
clientid | hexstring | DUID-LL type 3 | Override the DHCP client identifier. |
ifaceid | IPv6 suffix | link-local identifier | Override the interface identifier learned through RA. |
dns | IP list | none | Add or replace DHCP DNS when peerdns is 0. |
peerdns | boolean | 1 | Use DNS supplied by DHCP. |
defaultroute | boolean | 1 | Create an IPv6 default route from the received gateway. |
reqopts | number list | none | Extra DHCP options to request. |
defaultreqopts | boolean | 1 | With 0, request only entries in reqopts. |
sendopts | string | none | Extra options in option:value form. |
noslaaconly | boolean | 0 | Do not allow SLAAC-only configuration. |
forceprefix | boolean | 0 | Require an IPv6 prefix in the DHCP message. |
norelease | boolean | 0 | Do not send RELEASE when the interface goes down. |
ip6prefix | IPv6 prefix | none | Add a user-provided prefix for distribution. |
iface_dslite | logical interface | none | DS-Lite auto-configuration template; 0 disables it. |
zone_dslite | string | none | Firewall zone for the DS-Lite interface. |
iface_map | string | none | Template for map-e/map-t/lw4o6 auto-configuration. |
zone_map | string | none | Firewall zone for the map interface. |
iface_464xlat | string | none | 464xlat template; 0 disables auto-configuration. |
zone_464xlat | string | none | Firewall zone for the 464xlat interface. |
zone | string | none | Firewall zone receiving the interface. |
sourcefilter | boolean | 1 | Enable source-based IPv6 routing. |
vendorclass | string | none | Vendor class, DHCP option 16. |
userclass | string | none | User class, DHCP option 15. |
delegate | boolean | 1 | Enable prefix delegation for DS-Lite/map/464xlat. |
soltimeout | integer | 120 | Maximum solicit timeout. |
fakeroute | boolean | 1 | Fake a default route when RA contains no route. |
ra_holdoff | integer seconds | 3 | Minimum time between accepted RA updates. |
noclientfqdn | boolean | 0 | Do not send Client FQDN option 39. |
For automatic DS-Lite from DHCPv6, the source requires an interface with option auto 0, its name in iface_dslite, and that interface added to a suitable firewall zone.1
Static IPv6 connection
When the ISP assigns static values, retain ip6addr, ip6gw, ip6prefix, and DNS as in the following example. The 2001:db80:: addresses are documentation values, not values to copy into a real network.1
| |
Downstream LAN configuration
Static IPv6 options
ip6addr assigns an address; ip6ifaceid can be eui64, random, or a fixed suffix; ip6gw is the gateway; ip6assign controls the delegated prefix length; ip6hint is a hexadecimal subprefix ID; ip6prefix routes a prefix to other interfaces; ip6class filters prefix classes; and dns, dns_search, dns_metric, and metric control DNS and route selection. These options belong to the static protocol and should not be mixed blindly with DHCPv6 assumptions.
Prefix delegation with ip6assign, ip6hint, and ip6class
ip6assign 64delegates/64prefixes to an interface.ip6hintsuggests an ID, for example1234can produce...:1234::/64.ip6class wan6accepts only thewan6prefix class;localaccepts only ULA.- If the prefix is insufficient, OpenWrt can change the ID or reduce the length; an unsuitable
ip6hintis rounded down. - An
ip6assignvalue below64lets DHCPv6-PD hand remaining/64s to downstream routers.
The source's LAN/guest example retains ULA, selects prefixes with ip6hint, and restricts guest to class wan6:1
| |
In that example, lan receives 2001:db80:0:10::/60 and fd00:db80:0:10::/60, while guest receives only 2001:db80:0:abcd::/64. If the router can ping6 but LAN clients report Destination unreachable: Unknown code 5 or Source address failed ingress/egress policy, I check ip6assign on LAN first.
Router Advertisement and DHCPv6
SLAAC and DHCPv6
OpenWrt can advertise RA, provide stateless/stateful DHCPv6, and offer DHCPv6-PD. The combined SLAAC and DHCPv6 server example is:
| |
The source notes that a tunnel with a fixed LAN prefix should remove ndp when NDP proxying is not wanted.
SLAAC only
For SLAAC-only clients, disable DHCPv6 and clear the RA flags as follows. The source notes that some clients, including Android, may prefer IPv4 when DHCPv6 is disabled:1
| |
IPv6 relay
Relay helps when an upstream router provides IPv6 but no DHCPv6-PD. This is the source's two-sided relay configuration:
| |
Routing management
OpenWrt uses source-address/source-interface policy routing for multiple uplinks. Delegated prefixes can receive unreachable routes to prevent loops. I inspect ifstatus wan6; the following shortened sample shows a /64 address, a /56 delegated prefix assigned as /60 to LAN, and a default route through a link-local gateway:1
| |
Read two details from the output: 2001:db80::/48 and ::/0 use fe80::800:27ff:fe00:0, but only traffic with a suitable source address can use them. A route table alone is not enough; test from a LAN client.
ULA prefix
ULA can provide stable IPv6 suffixes with DHCPv6, site-to-site connectivity when the GUA changes or disappears, or NAT66 when the ISP supplies no GUA. Without a GUA, I treat this as a limited workaround rather than claiming ULA is Internet-routable.
Testing and recovery
After reloading the network, check ifstatus wan6, ip -6 addr, ip -6 route, RA on a client, and firewall logs. If the new configuration breaks access, restore the prepared /etc/config/network and /etc/config/dhcp copies through console; never paste the source's example prefix into a production network unchanged.


Góp Ý / Bình Luận / Đánh giá