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 → NetworkInterfaces

  1. Edit the WAN Interface (The physical interface corresponding to the port connected to OpenWRT_A)
  2. Protocol: Select “DHCPv6 Client” (If it was previously static or disabled)
  3. Switch to the “Advanced Settings” tab:
    • “Request IPv6 Prefix”: Check ✓
    • “Requested IPv6 Prefix Length”: Select “Automatic” or manually enter 60
  4. Switch to the “Physical Settings” tab: Confirm the interface binding is correct (e.g., eth0.2 or LAN port)
  5. Save

Step 2: Configure OpenWRT_B’s LAN Port (Connected to Your PC)

Still in NetworkInterfacesEdit LAN Interface

  1. Switch to the “General Settings” tab:

    • IPv6 Allocation Length: Select 63 (Crucial!)
  2. Switch to the “IPv6 Settings” tab:

    • “IPv6 assignment hint”: Enter a subnet ID (e.g., 1 or 2, 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 ✓
  3. Save and Apply

Step 3: Check DHCPv6 Server Configuration

Go to ServicesDHCP/DNS

  1. Switch to the “Advanced Settings” tab:
    • Ensure “Disable IPv6 DNS Resolution” is unchecked
  2. Switch to the “IPv6 RA Settings” tab:
    • RA Flags: Check managed and other
  3. Save and Apply

Step 4: Adjust Firewall (Crucial)

Go to NetworkFirewall

  1. Edit the “wan” zone:

    • Forwarding: Select “Accept” or ensure there is a rule allowing forwarding to the LAN zone
    • Covered Networks: Confirm it includes wan and wan6
  2. Edit the “lan” zone:

    • Forwarding: Select “Accept”
    • Covered Networks: Confirm it includes lan
  3. 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 wan6 should 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::/56 pointing 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

IssueCauseSolution
OpenWRT_B cannot obtain PDOpenWRT_A did not correctly delegate the PD prefixIn OpenWRT_A’s WAN6 interface Advanced Settings, change “IPv6 Prefix Length” to 60 or 56
PC cannot obtain addressRA/DHCPv6 services are disabled or blocked by the firewallCheck LAN interface IPv6 settings are set to “Server Mode,” and confirm the firewall allows forwarding
Address obtained but no internetMissing default route or DNSEnsure “Always announce default router” is checked in RA settings, and check DNS configuration
IPv6 address conflictSubnet ID conflicts with OpenWRT_AModify 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: 60 or 56
  • 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.