Openwrt 获取不到ipv6: Configuration and Setup

Author

Reads 1.3K

A sleek WiFi 6 router with antennas and cable on a wooden desk, perfect for modern home networks.
Credit: pexels.com, A sleek WiFi 6 router with antennas and cable on a wooden desk, perfect for modern home networks.

If you're struggling to get IPv6 working on OpenWRT, you're not alone. The issue is often caused by a misconfigured firewall.

First, ensure that the firewall rules are set to allow IPv6 traffic. This can be done by navigating to the firewall settings in the LuCI web interface and adding a rule to allow IPv6 traffic on the desired interface.

A common mistake is to forget to enable IPv6 on the interface itself. Make sure to check the interface settings and enable IPv6 if it's not already enabled.

Explore further: Openwrt Interface

Preconditions

To get started with openwrt, you'll need to meet some preconditions. The first thing to check is that your internet service provider (ISP) is providing IPv6 addresses, as most ISPs now offer this feature.

Three major ISPs in your area likely provide IPv6 addresses with their home broadband plans. Confirm that your router has IPv6 enabled, specifically that the Internet connection is set to IPv4&IPv6.

Your broadband plan must be able to obtain an IPv6-PD address to use this solution. If not, you'll need to look into alternative solutions for now.

Openwrt Configuration

Credit: youtube.com, 【全网唯一】OpenWrt IPV6 完整教程 | 主路由+旁路由,科学环境下轻松搞定直播、远程、代理!

To get OpenWrt configured, you'll need to ensure your router is set up correctly. OpenWrt/ImmortalWrt firmware requires a specific IPv6 setting scheme, which is only detailed for OpenWrt/ImmortalWrt firmware, not LEDE.

Before proceeding, make sure you've already set your optical modem to bridge mode and are using OpenWrt as the main router for dialing. To change your optical modem to bridge mode, call the maintenance technician's phone number on the modem.

Here's an interesting read: Openwrt Firmware

Dnsmasq Configuration

If you don't disable this setting, Dnsmasq won't return IPv6 addresses in its DNS resolution, making it impossible to access IPv6 websites.

To fix this, you'll need to explore the Dnsmasq settings on your own, as the exact configuration details are not provided here.

The Dnsmasq settings are crucial to enabling IPv6 access, so be sure to check and adjust them accordingly.

On a similar theme: Openwrt Ap

1.1 Dnsmasq

If you don't disable Dnsmasq, it won't return IPv6 addresses, making it impossible to access IPv6 websites.

Dnsmasq needs to be configured properly to function correctly, and it's not a straightforward process.

To get IPv6 addresses, you'll need to figure out the specific settings for Dnsmasq, as the exact configuration details are not provided here.

Local DNS

Credit: youtube.com, Enabling dnsmasq - speeding up connections with local DNS cache.

Local DNS is a crucial aspect of Dnsmasq configuration. You can use IPv4 DNS to resolve IPv6 addresses without needing to configure IPv6 DNS settings.

The ability to resolve IPv6 addresses is not dependent on the server having an IPv6 address. For instance, if your OpenWrt's upstream DNS server provides IPv6 domain name resolution, your OpenWrt's Dnsmasq can provide IPv6 domain name resolution services.

Even if your device only obtains an IPv4 address, you can still resolve IPv6 addresses using IPv4 DNS. This is because your device can use the IPv4 DNS address of your router (e.g. 192.168.1.1) to resolve IPv6 addresses.

In my experience, this can sometimes cause issues where you can ping your router's IPv4 address but not its IPv6 address. To resolve this, simply uncheck the "Local IPv6 DNS server" option and uncheck "Other configuration" in the RA settings. This will prevent your router from advertising IPv6 DNS addresses to your device.

By doing so, you can force your device to use IPv4 DNS to resolve IPv6 addresses, which can help avoid problems.

Expand your knowledge: Openwrt Travel Router

WAN Settings

Credit: youtube.com, 【全网最细】ipv6工作流程详解,openwrt软路由配置ipv6教程,homeproxy、openclash代理ipv6流程,sing-box、mihomo,ipv6科学上网不冲突,ipv6代理

To set up your WAN settings for IPv6, you'll want to start by deleting any existing WAN6 interface. This is because you'll be creating a new one later on.

In the WAN interface's advanced settings, make sure to enable IPv6 and check the box for using the provider's DNS. It's also essential to disable IPv6 allocation length and enable delegated IPv6 prefix. Don't fill in the IPv6 preference field, as this can prevent you from getting an address.

To confirm, here are the specific steps to follow:

  • Disable DHCP > IPv6 settings
  • Enable IPv6 and use provider's DNS
  • Disable IPv6 allocation length
  • Enable delegated IPv6 prefix

After applying these settings, a virtual wan_6 interface should appear. Check the IPv6-PD address in the red box to ensure you've obtained it. If you don't have a PD address, it's likely due to your PD address being occupied by the upper-level router or your provider not offering it.

WAN口设置地址

To set the WAN address, you'll need to delete the existing WAN6 interface and enable IPv6 in the WAN settings. Open the WAN interface's advanced settings and check the box to use the provider's announced DNS.

Credit: youtube.com, OPENWRT WAN6 Configuration

Disable IPv6 prefix length and enable delegated IPv6 prefix. Leave the IPv6 preference field blank, as filling it in may prevent you from getting an address.

Check the WAN interface's DHCP settings to ensure IPv6 is disabled. Save and apply the settings, and a virtual WAN_6 interface should appear. Verify the IPv6-PD address in the red box to ensure you've obtained it.

If you don't have a PD address, it may be because your PD address is being used by a higher-level router, or your provider hasn't given you one. If it's the former, you can't use this method. If it's the latter, call your provider's technical support to confirm whether your connection can provide an IPv6-PD address and whether your modem bridge settings include IPv4 and IPv6.

Here are the steps to create a new WAN6 interface:

  1. Create a new interface in OpenWrt > Network > Interfaces, and name it WAN6
  2. Configure WAN6 according to the diagram
  3. Save and apply the configuration
  4. Verify that WAN6 has obtained an IPv6-PD address

Wan6 Port

To set up the Wan6 port, head to the network settings and navigate to the WAN6 interface.

Credit: youtube.com, OpenWRT - Configure LAN port as WAN port

The protocol should be set to DHCPv6 client, which will automatically obtain an IPv6 address from your ISP's router, allowing IPv6 traffic to flow through the Wan6 port.

Wan and Wan6 are essentially the same interface, but are separated into two logical interfaces for easier network configuration.

If you need to use your ISP's DNS server, check the box for "Use DNS servers advertised by peer."

For another approach, see: Openwrt Dyndns

Port Forwarding

Port Forwarding can be a bit tricky, but don't worry, I've got you covered.

First, let's clarify that you don't actually need port forwarding for IPv6, as your devices will be getting public IPv6 addresses, and you can just set up the firewall to allow the necessary traffic.

The default firewall rules in OpenWrt block all data packets except ICMP, which is a security feature to prevent devices from being exposed to the public internet.

To access your devices from the public internet, you'll need to set up firewall communication rules to allow traffic to specific ports, such as port 5000 for Synology or port 22 for SSH.

You only need to fill in the last 16 bits of your device's IPv6 address, which is the part generated by the MAC address. This way, the firewall rule will match the device regardless of any changes to the prefix issued by your ISP.

Local Network

Credit: youtube.com, OpenWRT关于IPV6的一些设置

In a local network, your OpenWrt router can provide IPv6 domain name resolution services even if it doesn't have an IPv6 address itself.

Your OpenWrt router can act as a DNS server, and if your local devices obtain an IPv6 address and can access the IPv6 network, they can still resolve IPv6 domain names using the IPv4 DNS address of the router.

If you're experiencing issues with your Win11 system occasionally being able to ping the OpenWrt router's IPv4 address but not its IPv6 ULA address, try unchecking the "Local IPv6 DNS server" option and removing the "Other configuration" checkmark in the RA settings.

This will prevent OpenWrt from advertising IPv6 DNS addresses to your devices, forcing them to use the IPv4 DNS address to resolve IPv6 domain names.

You can simply use the IPv4 DNS address (like your router's 192.168.1.1) to get IPv6 resolution results without messing with IPv6-related DNS settings.

Addressing

IPv6 addresses are divided into three classes: Global-unicast, Unique Local, and Link-local. Global-unicast addresses are like IPv4's public IP addresses, while Unique Local addresses are similar to IPv4's private IP addresses, but for IPv6. Link-local addresses are used for direct communication on the same link and are not routed.

On a similar theme: Openwrt Tp Link Archer

Credit: youtube.com, openwrt软路由如何快速开启IPv6|家庭宽带开启ipv6上网,开启宽带的IPV6地址,可实现随时随地访问家中的软路由和其他设备,ipv6科学上网设置,解决没有公网ip的问题#一瓶奶油

The most common type of IPv6 address is the Global-unicast address, which is used for internet access. The range for Global-unicast addresses is 2000::/3. Unique Local addresses have a prefix of fc00::/7 and are used within an organization or company. Link-local addresses have a prefix of fe80::/10 and are used for communication on the same link.

Here are the three classes of IPv6 addresses:

Address Classes

There are three main classes of IPv6 addresses: Global-unicast, Unique Local, and Link-local.

Global-unicast IPv6 addresses are similar to IPv4 public IP addresses, but they're globally unique and used for internet access. They're currently only being used in the 2000::/3 range.

Unique Local IPv6 addresses are similar to IPv4 private IP addresses, and are used within an organization or company. They're prefixed with fc00::/7 and are commonly used in the fd00::/8 range.

Link-local IPv6 addresses are used for communication within a local network, and are automatically assigned based on the MAC address. They're prefixed with fe80::/10 and are commonly used in the fe80::/64 range.

Here's a breakdown of the main address classes:

Address Specification

Credit: youtube.com, IP Addresses Explained: Networking Basics

An IPv6 address is typically 128 bits long, divided into eight groups of 16 bits each, separated by colons. The address can be written in a more compact form by omitting leading zeros.

You can write an IPv6 address in several ways, such as fddd:f00d:cafe:0000:0000:0000:0000:0001 or fddd:f00d:cafe:0:0:0:0:1.

Here are some common IPv6 address ranges:

Note that the Link-Local address range is actually only used for fe80::/64, and is generated automatically by the device's MAC address when IPv6 is enabled.

分发方式

There are two ways to distribute IPv6 addresses: SLAAC and DHCPv6.

SLAAC, or Stateless Auto Configuration, is an automatic configuration method that allows devices to generate their own IPv6 addresses without the need for a DHCP server. This method is supported by all types of devices and is the recommended choice for most networks.

SLAAC uses the Neighbor Discovery Protocol (NDP) to automatically configure IPv6 addresses. Devices will generate a Link-Local address (fe80::/10) on each interface, which can only be used for local communication. They will also broadcast a request for a router advertisement (RS) to find a router on the network, which will respond with a router advertisement (RA) containing the subnet prefix. The device will then combine the subnet prefix with its interface ID to create a unique IPv6 address.

A silver network router with multiple USB ports, perfect for small offices.
Credit: pexels.com, A silver network router with multiple USB ports, perfect for small offices.

DHCPv6, on the other hand, is a stateful autoconfiguration method that uses a DHCP server to distribute IPv6 addresses to devices. This method is useful when you need to assign specific addresses to devices or when you need to prevent address conflicts.

Here are the two methods summarized:

It's worth noting that SLAAC and DHCPv6 can coexist on the same network, and devices can use both methods to obtain IPv6 addresses. However, DHCPv6 is not supported by all devices, including some Android devices and smart home devices.

Address Allocation

Address Allocation is a crucial step in setting up IPv6 on OpenWrt. You can allocate IPv6 addresses to devices on your network using either SLAAC (Stateless Address Autoconfiguration) or DHCPv6.

SLAAC is a good choice for most devices, as it allows them to generate their own IPv6 addresses based on their MAC addresses. This method is supported by all types of devices.

Credit: youtube.com, IPv6 with OpenWrt

If you choose to use SLAAC, you can enable it by going to LAN > Advanced Settings > IPv6 and selecting the "SLAAC" option. You can also specify the EUI-64 parameter to generate a fixed IPv6 address based on the device's MAC address.

Here's a breakdown of the different types of IPv6 addresses:

Note that the Link-Local address range fe80::/10 is only used in practice for the fe80::/64 range, which is automatically generated by the router based on the device's MAC address.

基础知识

OpenWRT 是一个开源的路由器固件,基于 Linux 内核开发。它允许用户自定义路由器的配置和功能。

OpenWRT 支持多种硬件平台,包括路由器、交换机和其他设备。

OpenWRT 的配置文件通常存储在 /etc/config 目录下。

OpenWRT 的网络配置通常存储在 /etc/config/network 文件中。

OpenWRT 支持 IPv6,但需要额外的配置才能启用。

See what others are reading: Config Openwrt

Network Types

There are three main network types when it comes to campus networks: Relay, Bridge, and NAT6.

Relay is a relatively easy solution, often working out of the box with many routers. However, it may not always work as expected, and you may need to dig deeper to get it working.

Bridge is a more complex solution, but it's often the most stable option. According to personal experience, it's like having an IPv4 router and an IPv6 switch combined.

Explore further: Openwrt Bridge Mode

Credit: youtube.com, IPv6 Basics for Beginners

NAT6 is the most complex solution, but it's also the most stable in some cases. It's essentially like having an IPv4 NAT, but for IPv6.

Here are the three network types summarized:

Troubleshooting

If you're experiencing issues with getting an IPv6 address on OpenWRT, the first step is to check if your router is configured to obtain an IPv6 address automatically.

Make sure the IPv6 protocol is enabled on your router by checking the "Network" or "Advanced Setup" section of the OpenWRT web interface.

Verify that the IPv6 method is set to "DHCP" or "SLAAC" in the "IPv6 Settings" section.

Ensure that the IPv6 interface is enabled on your router by checking the "Network" or "Advanced Setup" section of the OpenWRT web interface.

Check the "System Log" section for any errors related to IPv6 configuration or connection issues.

If you're using a VPN or proxy, try disabling it to see if it's causing the issue.

Check your ISP's IPv6 settings to ensure they are configured correctly.

Verify that the IPv6 address is not being blocked by a firewall or router settings.

Viola Morissette

Assigning Editor

Viola Morissette is a seasoned Assigning Editor with a passion for curating high-quality content. With a keen eye for detail and a knack for identifying emerging trends, she has successfully guided numerous articles to publication. Her expertise spans a wide range of topics, including technology and software tutorials, such as her work on "OneDrive Tutorials," where she expertly assigned and edited pieces that have resonated with readers worldwide.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.