openwrt 开启ipv6 无法访问外网配置

Author

Reads 1.2K

Smart home wireless network router device
Credit: pexels.com, Smart home wireless network router device

Enabling IPv6 on OpenWRT can sometimes cause issues accessing the internet. This is because the default IPv6 configuration on OpenWRT is set to "radvd" which might not work properly.

The root cause of this problem is usually related to the "radvd" configuration.

To solve this issue, you need to change the default IPv6 configuration on OpenWRT to "dhcpv6c" or "dnsmasq".

This can be done by editing the "network" configuration file in OpenWRT.

拨号获取

要开启拨号获取 IPv6 地址,需要在 OpenWrt 的设置中勾选「委托 IPv6 前缀」。这会让 OpenWrt 去询问运营商的 IPv6 前缀。

指定的主接口应该不勾选,因为我们希望 OpenWrt 自动识别出适合的接口。

RA 服务和 DHCPv6 服务应该禁用,因为我们已经选择了自动获取 IPv6 地址。

NDP 代理也应该禁用。

保存应用后,OpenWrt 通常会多出一个名为 wan_6 的虚拟动态接口。这是因为大部分营运商是通过 DHCPv6 下发地址的。

如果运营商支持,应该就能看到获取的前缀了(PD)。

注意,如果只有 fe80:: 开头的地址,则说明未获取到 IPv6,这个只是自动生成的链路地址而已。

Problem Description

Let's take a closer look at the problem description. The issue arises when OpenWrt is used in a campus network environment. The router successfully obtains both IPv4 and IPv6 addresses.

The SSH connection to the router tests the router's ability to ping IPv6 addresses, which it can do successfully. However, the computer connected to the router via the network card also obtains both IPv4 and IPv6 addresses, but it cannot access or use IPv6 address resources and cannot ping IPv6 addresses.

The IPv6 testing website also shows that IPv6 cannot be accessed normally. On the other hand, IPv4 addresses can be accessed normally.

See what others are reading: Openwrt Travel Router

原因分析

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

Connecting to the router with a computer's network card also obtains an IPv6 address, but it's likely an internal IPv6 address, which makes it impossible to access external IPv6 address resources.

This is because the computer's network card is obtaining an IPv6 address from the router, but it's not getting a valid external IPv6 address that can be used to access the internet.

The reason for this is that the router is not providing a valid external IPv6 address to the computer's network card.

This is a common issue with IPv6 configuration, and it can be frustrating to troubleshoot.

Here are some possible reasons why this might be happening:

  • The router is not configured to provide external IPv6 addresses to connected devices
  • The computer's network card is not configured to obtain an external IPv6 address
  • There is a conflict between the router's IPv6 configuration and the computer's network card settings

Wan Settings

To access the internet via IPv6, you need to set up your WAN interface properly. In the network settings, go to WAN and uncheck the box for using the built-in IPv6 management.

Make sure your modem is set to bridge mode and you're using OpenWrt as your main router. This is a crucial step for the IPv6 settings to work correctly.

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

In the WAN6 settings, select DHCPv6 client as the protocol. This will allow your device to automatically get an IPv6 address from your ISP, enabling IPv6 traffic to flow through the WAN6 interface.

To use your ISP's DNS servers, check the box for using the DNS servers advertised by the remote end. If you want to use custom DNS servers, simply enter the addresses manually.

Curious to learn more? Check out: Openwrt Dyndns

Lan Settings

To set up your LAN settings for IPv6, click on "网络-接口-LAN" in the basic settings.

Setting the IPv6 分配长度 to 64 will allow devices on your LAN to automatically configure their IPv6 addresses.

You can also set the IPv6 后缀 to ::1 for a more concise IPv6 address for your main router's LAN port.

However, it's generally recommended not to use the 内置的 IPv6 管理 in the advanced settings.

If you need to assign DHCPv6-PD to a downstream router, you may need to set the IPv6 分配长度 to a smaller value, such as 60 or 56, depending on the length of the DHCPv6-PD prefix provided by your ISP.

To do this, click on the DHCP 服务器 and then the IPv6 设置.

For your interest: Wake on Lan Openwrt

OpenWrt Settings

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

To enable IPv6 on OpenWrt, you need to have OpenWrt installed on your router and ensure that your modem is set to bridge mode.

First, open the LuCI web interface of your OpenWrt router and navigate to the IPv6 settings section.

You can only access the IPv6 settings for OpenWrt/ImmortalWrt firmware, not for LEDE firmware.

To configure IPv6 on OpenWrt, make sure you have already set up your modem in bridge mode and are using OpenWrt as your main router to connect to the internet.

Ensure that the IPv6 protocol is enabled in the OpenWrt settings, which can be found under the Advanced Settings section.

The IPv6 settings scheme for OpenWrt/ImmortalWrt firmware is detailed in the provided setting steps, but note that similar steps may not be available for LEDE firmware.

If this caught your attention, see: Openwrt Firmware

Emanuel Anderson

Senior Copy Editor

Emanuel Anderson is a meticulous and detail-oriented Copy Editor with a passion for refining the written word. With a keen eye for grammar, syntax, and style, Emanuel ensures that every article that passes through their hands meets the highest standards of quality and clarity. As a seasoned editor, Emanuel has had the privilege of working on a diverse range of topics, including the latest developments in Space Exploration News.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.