Introduction
In modern home networking setups, IPv6 has become increasingly important as IPv4 addresses become more scarce. Many ISPs now provide IPv6 connectivity, but properly configuring it in a network with multiple routers and services can be challenging. This guide will walk you through setting up IPv6 in a network where: 小米主路由拨号 旁路由op dhcp adguardhome 怎么配置ipv6
- A Xiaomi router serves as the main router handling PPPoE dial-up
- An OpenWRT device functions as a secondary router (often called a “side router” or “旁路由” in Chinese)
- AdGuard Home is handling DHCP services
This configuration is popular among networking enthusiasts who want to combine the stability of commercial router hardware with the flexibility of OpenWRT and the ad-blocking capabilities of AdGuard Home.
Prerequisites
Before beginning, ensure you have:
- A Xiaomi router (models like AX3600, AX6000, or AX9000 work well) as your main router
- A secondary device running OpenWRT (could be a Raspberry Pi, x86 device, or another router)
- AdGuard Home installed and configured on your OpenWRT device or a separate machine
- Basic familiarity with networking concepts and router administration
- An ISP that provides IPv6 connectivity (check with your provider)
Understanding the Network Topology
In this setup:
- Xiaomi Main Router: Handles the PPPoE connection to your ISP, performs NAT (if needed), and serves as the primary gateway.
- OpenWRT Side Router: Typically handles more advanced functions like ad-blocking, VPN services, or other network enhancements.
- AdGuard Home: Provides DNS services with ad-blocking capabilities and may handle DHCP assignments.
For IPv6 to work properly, we need to ensure:
- IPv6 connectivity is properly established from the ISP
- The Xiaomi router correctly obtains and routes IPv6 addresses
- The OpenWRT side router properly relays or handles IPv6 traffic
- AdGuard Home doesn’t interfere with IPv6 DNS resolution
- All devices on the network receive proper IPv6 addresses
Step 1: Configure IPv6 on the Xiaomi Main Router
First, we need to enable IPv6 on the Xiaomi router:
- Access your Xiaomi router’s web interface (typically at 192.168.31.1)
- Navigate to the Internet Settings or WAN settings section
- Look for IPv6 settings (exact location varies by firmware version)
- Enable IPv6 and select “Native” as the connection type (other options might be DHCPv6 or PPPoEv6 depending on your ISP)
- Set the IPv6 DNS servers (you can use public ones like Google’s 2001:4860:4860::8888 or Cloudflare’s 2606:4700:4700::1111)
- Save settings and reboot the router
After rebooting, check if the Xiaomi router has obtained an IPv6 address:
- Go to the router status page
- Look for WAN IPv6 address (should be a global address, not starting with fe80)
- Verify you have an IPv6 prefix delegation (typically a /60 or /56 range)
If IPv6 isn’t working at this stage, you may need to:
- Contact your ISP to ensure they provide IPv6
- Try different IPv6 connection types (Native, DHCPv6, etc.)
- Check for firmware updates for your Xiaomi router
Step 2: Configure OpenWRT as a Side Router
With the Xiaomi router handling the main PPPoE connection, we’ll configure OpenWRT as a side router:
- Connect the OpenWRT device to the Xiaomi router (typically via LAN port, not WAN)
- Access the OpenWRT web interface (typically 192.168.1.1)
- Navigate to Network > Interfaces
Configure LAN Interface:
- Edit the LAN interface
- Under General Settings, set protocol to “Static Address”
- Set IPv4 address to an address in your Xiaomi router’s subnet but outside its DHCP range (e.g., if Xiaomi is 192.168.31.1, use 192.168.31.2)
- Set IPv4 gateway to the Xiaomi router’s IP (192.168.31.1)
- Under IPv6 settings:
- Set RA-Service to “Relay Mode”
- Set DHCPv6-Service to “Relay Mode”
- Set NDP-Proxy to “Relay Mode”
- Under Physical Settings, ensure “Bridge interfaces” is unchecked
- Under Firewall Settings, assign to “lan” zone
- Save and apply
Configure DHCP and DNS:
- Navigate to Network > DHCP and DNS
- Under General Settings:
- Set “Ignore resolve file” to checked
- Add custom DNS servers if desired
- Under IPv6 Settings:
- Set “Router Advertisement-Service” to “relay mode”
- Set “DHCPv6-Service” to “relay mode”
- Set “NDP-Proxy” to “relay mode”
- Save and apply
Step 3: Configure AdGuard Home with IPv6 Support
If you’re using AdGuard Home for DHCP:
- Access your AdGuard Home web interface (typically port 3000)
- Navigate to DHCP settings
- Enable DHCP server if not already enabled
- Configure IPv4 range (make sure it doesn’t overlap with any static assignments)
- For IPv6:
- Enable DHCPv6
- Set an appropriate IPv6 range (you can use part of your delegated prefix)
- Set lease time (86400 seconds is typical)
- Under DNS settings:
- Ensure IPv6 resolution is enabled
- Add IPv6 DNS servers (can be same as IPv4 or specific IPv6 servers)
- Save settings
Step 4: Verify IPv6 Connectivity
After configuring all components, verify IPv6 is working:
- From a connected device, visit an IPv6 test site like test-ipv6.com
- Check if you get 10/10 for IPv6 tests
- From command line (Windows: cmd, Mac/Linux: terminal):
- Run
ping6 google.com
orping -6 google.com
- Run
tracert -6 google.com
ortraceroute6 google.com
to see the IPv6 route
- Run
- Check IP assignment:
- Run
ipconfig /all
(Windows) orifconfig
(Mac/Linux) to see if you have a global IPv6 address (not starting with fe80)
- Run
Troubleshooting Common IPv6 Issues
If IPv6 isn’t working, try these steps:
- No IPv6 Address on Devices:
- Check if the Xiaomi router is getting an IPv6 WAN address
- Verify RA (Router Advertisement) is working – run
netsh interface ipv6 show route
(Windows) to see if you’re receiving RAs - Ensure no firewall is blocking ICMPv6 which is essential for IPv6
- IPv6 Connectivity But No Internet:
- Check DNS resolution over IPv6 (
nslookup google.com 2001:4860:4860::8888
) - Verify your IPv6 gateway is correct
- Ensure your ISP isn’t blocking IPv6 traffic
- Check DNS resolution over IPv6 (
- Slow IPv6 Performance:
- Try different IPv6 DNS servers
- Check for IPv6 MTU issues (try lowering MTU on WAN interface)
- Verify proper prefix delegation
- AdGuard Home Blocking IPv6:
- Check AdGuard Home query log for IPv6 domains being blocked
- Review DNS configuration in AdGuard Home
- Ensure DHCPv6 is properly configured in AdGuard Home
Advanced IPv6 Configuration Options
For users who want more control over their IPv6 network:
- Static IPv6 Assignments:
- Configure static IPv6 assignments in AdGuard Home for specific devices
- Use DHCPv6 unique identifiers (DUIDs) for consistent assignments
- IPv6 Firewall Rules:
- On OpenWRT, configure firewall rules for IPv6 in Network > Firewall
- Consider blocking incoming IPv6 connections while allowing outgoing
- Custom IPv6 Prefix:
- If your ISP allows, request a specific IPv6 prefix
- Divide your prefix for different subnets or VLANs
- IPv6 Monitoring:
- Set up monitoring for IPv6 traffic
- Use tools like vnstat or ntopng to track IPv6 usage
Security Considerations for IPv6
IPv6 introduces some unique security considerations:
- Global Address Exposure:
- Unlike IPv4 NAT, IPv6 addresses are typically globally routable
- Ensure your firewall is properly configured to block unwanted incoming connections
- Privacy Extensions:
- Windows and other OSes use temporary IPv6 addresses for privacy
- This can make device identification more difficult
- Consider whether to enable or disable based on your needs
- Router Advertisement Protection:
- Implement RA Guard to prevent rogue RA messages
- Configure DHCPv6 guard if available on your switches
- DNS Security:
- Ensure DNSSEC is properly configured
- Consider using DNS-over-HTTPS or DNS-over-TLS for IPv6 DNS queries
Performance Optimization
To get the best performance from your IPv6 setup:
- PMTU Discovery:
- Ensure Path MTU Discovery is working properly
- ICMPv6 “Packet Too Big” messages must not be blocked
- DNS Configuration:
- Use fast, reliable IPv6-capable DNS servers
- Consider running DNS benchmarks to find the fastest servers
- Prefix Delegation:
- Request an appropriately sized prefix from your ISP
- Larger prefixes (/56 instead of /64) allow for more subnetting flexibility
- Router Hardware:
- Ensure your routers can handle IPv6 at line speed
- Some older routers may have slower IPv6 performance due to lack of hardware acceleration
Migrating Services to IPv6
Once IPv6 is working, consider migrating services:
- Remote Access:
- Use IPv6 for remote access to your network
- Set up dynamic DNS for your IPv6 prefix
- Server Services:
- Configure web servers, game servers, etc. to listen on IPv6
- Update firewall rules accordingly
- VPN Configuration:
- Ensure your VPN supports IPv6
- Configure IPv6 routing through your VPN if desired
Conclusion
Configuring IPv6 in a network with a Xiaomi main router, OpenWRT side router, and AdGuard Home handling DHCP requires careful attention to how IPv6 addressing and routing works across these components. By following this guide, you should have a fully functional IPv6 setup that coexists with your existing IPv4 network.
The key points to remember are:
- Start with proper IPv6 configuration on the Xiaomi main router
- Configure OpenWRT to properly relay IPv6 traffic and advertisements
- Ensure AdGuard Home is configured to support IPv6 DNS and DHCP
- Verify connectivity at each step
- Implement appropriate security measures for IPv6
With IPv6 becoming increasingly important, taking the time to properly configure it now will ensure your network is ready for the future of internet connectivity. As you become more comfortable with IPv6, you can explore more advanced configurations and optimizations to get the most out of your network.