Core Solution: Configuring OpenWRT_B to Obtain a Subprefix via DHCPv6-PD
The core key is to assign a suitable prefix length to the corresponding interface and ensure that DHCPv6 and RA services are correctly enabled. A minimum of /63 is required to allocate a /64 subnet to the next-level router.
Step 1: Configure OpenWRT_B’s WAN Port (Connected to OpenWRT_A)
Go to the OpenWRT_B management interface → Network → Interfaces
- Edit the WAN Interface (The physical interface corresponding to the port connected to OpenWRT_A)
- Protocol: Select “DHCPv6 Client” (If it was previously static or disabled)
- Switch to the “Advanced Settings” tab:
- “Request IPv6 Prefix”: Check ✓
- “Requested IPv6 Prefix Length”: Select “Automatic” or manually enter
60
- Switch to the “Physical Settings” tab: Confirm the interface binding is correct (e.g., eth0.2 or LAN port)
- Save
Step 2: Configure OpenWRT_B’s LAN Port (Connected to Your PC)
Still in Network → Interfaces → Edit LAN Interface
Switch to the “General Settings” tab:
- IPv6 Allocation Length: Select
63(Crucial!)
- IPv6 Allocation Length: Select
Switch to the “IPv6 Settings” tab:
- “IPv6 assignment hint”: Enter a subnet ID (e.g.,
1or2, to avoid conflict with OpenWRT_A’s LAN) - “IPv6 suffix”: Can be left blank or set to
::1 - RA Service: Select “Server Mode”
- DHCPv6 Service: Select “Server Mode”
- NDP Proxy: Select “Disabled”
- RA Management: Select “Enabled”
- Always announce default router: Check ✓
- “IPv6 assignment hint”: Enter a subnet ID (e.g.,
Save and Apply
Step 3: Check DHCPv6 Server Configuration
Go to Services → DHCP/DNS
- Switch to the “Advanced Settings” tab:
- Ensure “Disable IPv6 DNS Resolution” is unchecked
- Switch to the “IPv6 RA Settings” tab:
- RA Flags: Check
managedandother
- RA Flags: Check
- Save and Apply
Step 4: Adjust Firewall (Crucial)
Go to Network → Firewall
Edit the “wan” zone:
- Forwarding: Select “Accept” or ensure there is a rule allowing forwarding to the LAN zone
- Covered Networks: Confirm it includes
wanandwan6
Edit the “lan” zone:
- Forwarding: Select “Accept”
- Covered Networks: Confirm it includes
lan
Save and Apply
Verification and Troubleshooting
Execute the following commands on OpenWRT_B:
# Check if PD was successfully obtained
ifstatus wan6
# View LAN port IPv6 address
ifconfig br-lan | grep inet6
# View routing table
ip -6 route
# View DHCPv6 server status
logread | grep dhcp6
Success Indicators:
ifstatus wan6should display the obtained IPv6-PD (e.g.,240e:39c:2bae:7001::/60)- The LAN port should have a public IPv6 address (e.g.,
240e:39c:2bae:7001::1/64) - The routing table should contain a default route of
240e:39c:2bae:7000::/56pointing to pppoe-wan
Verify on the PC:
# Windows
ipconfig /all | findstr IPv6
# Linux/macOS
ifconfig | grep inet6
# Test connectivity
ping -6 ipv6.google.com
Common Issues and Solutions
| Issue | Cause | Solution |
|---|---|---|
| OpenWRT_B cannot obtain PD | OpenWRT_A did not correctly delegate the PD prefix | In OpenWRT_A’s WAN6 interface Advanced Settings, change “IPv6 Prefix Length” to 60 or 56 |
| PC cannot obtain address | RA/DHCPv6 services are disabled or blocked by the firewall | Check LAN interface IPv6 settings are set to “Server Mode,” and confirm the firewall allows forwarding |
| Address obtained but no internet | Missing default route or DNS | Ensure “Always announce default router” is checked in RA settings, and check DNS configuration |
| IPv6 address conflict | Subnet ID conflicts with OpenWRT_A | Modify OpenWRT_B LAN’s “IPv6 assignment hint” to another value (1, 2, 3…) |
Recommended Configuration Summary
OpenWRT_A (Ensure):
- WAN6 Interface → Advanced Settings → IPv6 Prefix Length:
60or56 - DHCP/DNS → Advanced Settings → Check “Dynamic DHCP” and “RA”
OpenWRT_B (Key):
- WAN Interface: DHCPv6 Client + Request IPv6 Prefix
- LAN Interface: IPv6 Allocation Length /64 + RA/DHCPv6 Server Mode
- Firewall: Allow IPv6 forwarding from WAN to LAN
After configuration, restart OpenWRT_B’s WAN interface or the entire router. Wait 1-2 minutes for DHCPv6 to complete prefix negotiation, and your PC should obtain a public IPv6 address.