The current IPv4 address pool on the internet has been completely allocated, leading to the basic popularization of IPv6 addresses. It is essential for technicians using OpenWrt to understand the relevant basic information about IPv6. This article introduces some of the most commonly used configuration guides related to IPv6 on OpenWrt.
- IPv6 addresses are represented in hexadecimal notation, consisting of 8 fields, each made up of 4 hexadecimal digits, separated by colons.
- A complete IPv6 address converts to a binary representation of 128 bits, with each field occupying 16 bits.
- In the IPv6 address specification, the first 4 fields represent the network prefix, while the last 4 fields represent the device address (generated from the device’s MAC address according to the EUI-64 specification).
- IPv6 does not have a “subnet mask”; it only has a “network prefix”. If the “network prefix” of all devices is the same, they are considered to be in the same local area network.
- To access an IPv6 address directly via a browser, it must be enclosed in square brackets. For example: http://[2408:ffff:ffff:ffff:ffff:ffff:ffff:ffff]
Dial-up Internet Mode IPv6
If OpenWrt is used in a dial-up internet mode, the default configuration should allow IPv6 to function normally. If a public IPv6 address is not obtained, please contact your broadband service provider’s customer service or consult local maintenance personnel.
Note: When using PPPoE for dial-up, the default “wan6” interface must be deleted, as a virtual “wan_6” interface will be automatically generated upon successful dialing.

- The gateway address generally refers to the router itself, and other devices in the same network segment or subnet can access the gateway address.
- IPv6 addresses starting with fe80 are called link-local addresses, which do not participate in network communication and are only used for automatic address configuration, IPv6 neighbor discovery, etc.
- The IPv6 network prefix is issued by the network operator, which is a pool of addresses. The local router can further subdivide subnets based on this prefix, similar to the subnet mask in IPv4.

Secondary Router IPv6
If used as a secondary router, the default configuration can still allow IPv6 to function normally.

IPv6 Relay Mode
If a public IPv6 address is found on the WAN port, but other devices in the local area network have not obtained a public IPv6 address, this indicates that the upstream router has not issued IPv6-PD (prefix delegation). This situation is common in environments where a fiber modem is used for dialing. In this case, the OpenWrt interface configuration needs to be modified so that local devices can obtain public IPv6 addresses distributed by the upstream router.
First, modify the LAN port configuration, changing the options for “RA Service”, “DHCPv6 Service”, and “NDP Proxy” to “Relay Mode”.

Then modify the WAN port configuration, checking the “Specified Main Interface” option under the “IPv6 Settings” tab, and changing the options for “RA Service”, “DHCPv6 Service”, and “NDP Proxy” to “Relay Mode”.
After that, have the local devices reconnect to the network, and they should be able to obtain public IPv6 addresses.

DHCPv6 Mode
By default, all local area network devices automatically generate IPv6 addresses using SLAAC (Stateless Address Autoconfiguration). However, sometimes for easier management, DHCPv6 can be enabled to manually assign public IPv6 addresses to local area network devices, similar to the traditional DHCPv4 method, all operations can be performed on the router.
1. Disable the SLAAC function, open the “DHCP Server” – “IPv6 RA Settings” tab in the local area network interface, uncheck the “Enable SLAAC” option, and check the “Managed Configuration” option under “RA Flags”.

2. Use the DHCP server to configure static IPv6 addresses, mainly by customizing a hexadecimal suffix for the IPv6 address, which is the last field of the IPv6 address.

Using DHCPv6 to assign IPv6 addresses to local area network devices, demonstration effect image.

Configuring Local Area Network IPv6 Addresses
By default, OpenWrt generates a random local area network IPv6 address prefix according to the IPv6 local address specification each time “Restore Factory Settings” is performed. If needed, it can also be manually configured, but it must comply with network specifications. For details, refer to:RFC 4193

IPv6 Address Simplified Notation
A complete IPv6 address consists of 32 hexadecimal characters, which are inconvenient to remember and write, so a simplified notation is introduced, known as zero compression.
For example, the complete IPv6 address: 2408:8207:18ee:6790:0000:0000:0000:0001simplified IPv6 address: 2408:8207:18ee:6790::1
For example, the complete IPv6 address: fd23:822a:5a5a:0000:6038:e0ff:fec9:e830simplified IPv6 address: fd23:822a:5a5a:0:6038:e0ff:fec9:e830
For example, to represent any address in IPv6: 0000:0000:0000:0000:0000:0000:0000:0000 (equivalent to 0.0.0.0 in IPv4)simplified IPv6 any address: ::For example, to represent the loopback address in IPv6: ::1 (equivalent to 127.0.0.1 in IPv4)
- Consecutive zero fields can be replaced with a double colon.
- Fields that start with zero can omit the leading zero and any consecutive zeros.
- A field that is all zeros can be written as a single zero.
- In a simplified IPv6 address, a double colon can only be used once.
- Whether using a complete IPv6 address or a simplified address, both can communicate normally over the network.
Specific Notation for IPv6 Prefix Network Bits
The prefix network bits of IPv6, common prefix network bit notations can refer to the table below.
Note: The “f” in the following example IPv6 addresses indicates that users can customize.
Prefix Length | Applicable Scenarios | Example Address | Address Range |
---|---|---|---|
32 | National Internet RegistriesLarge Network Service Providers (ISPs)Large Internet Companies | 2001:0db8::/32 | 2001:0db8:0000:0000:0000:0000:0000:00002001:0db8:ffff:ffff:ffff:ffff:ffff:ffff |
40 | ISPs allocate to large enterprises | 2001:0db8:ab00::/40 | 2001:0db8:ab00:0000:0000:0000:0000:00002001:0db8:abff:ffff:ffff:ffff:ffff:ffff |
48 | ISPs allocate to medium-sized enterprises | 2001:0db8:abcd::/48 | 2001:0db8:abcd:0000:0000:0000:0000:00002001:0db8:abcd:ffff:ffff:ffff:ffff:ffff |
56 | ISPs allocate to small enterprises | 2001:0db8:abcd:1200::/56 | 2001:0db8:abcd:1200:0000:0000:0000:00002001:0db8:abcd:12ff:ffff:ffff:ffff:ffff |
60 | ISPs allocate to ordinary users | 2001:0db8:abcd:1230::/60 | 2001:0db8:abcd:1200:0000:0000:0000:00002001:0db8:abcd:123f:ffff:ffff:ffff:ffff |
64 | End device addresses | 2001:0db8:abcd:1234::/64 | 2001:0db8:abcd:1234:0000:0000:0000:00002001:0db8:abcd:1234:ffff:ffff:ffff:ffff |
Typically, ordinary home broadband users receive a 60 prefix network bit, and users can customize the last network bit to create multiple subnets. The available characters are: 0123456789abcdef (a total of 16, which can be used to create 16 subnets).
Specific writing examples for subnetting with a 60 prefix network bit:
Subnet One: 2001:0db8:abcd:1230:ffff:ffff:ffff:ffffSubnet Two: 2001:0db8:abcd:1231:ffff:ffff:ffff:ffffSubnet Three: 2001:0db8:abcd:1232:ffff:ffff:ffff:ffffSubnet Four: 2001:0db8:abcd:1233:ffff:ffff:ffff:ffff……Subnet Thirteen: 2001:0db8:abcd:123c:ffff:ffff:ffff:ffffSubnet Fourteen: 2001:0db8:abcd:123d:ffff:ffff:ffff:ffffSubnet Fifteen: 2001:0db8:abcd:123e:ffff:ffff:ffff:ffffSubnet Sixteen: 2001:0db8:abcd:123f:ffff:ffff:ffff:ffff
Note: The last four fields are used to represent the device address (interface ID).