Photoincat 2 IPv6 PPPoE:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
| 第19行: | 第19行: | ||
=== LAN 接口设置 (http://172.16.0.1:8080/cgi-bin/luci/admin/network/network) LAN === | === LAN 接口设置 (http://172.16.0.1:8080/cgi-bin/luci/admin/network/network) LAN === | ||
在 DHCPv6 相关配置中: | 在 DHCPv6 相关配置中: | ||
* RA 服务:''' | * RA 服务:'''混合模式''' | ||
* DHCPv6 服务:''' | * DHCPv6 服务:'''混合模式''' | ||
* NDP 代理:'''混合模式''' | * NDP 代理:'''混合模式''' | ||
| 第49行: | 第49行: | ||
* 防火墙规则确保外部 IPv6 流量可以按需进入 LAN/设备。 | * 防火墙规则确保外部 IPv6 流量可以按需进入 LAN/设备。 | ||
== IPv6 地址说明 == | |||
在查看接口(例如 '''eth0''')时,可能会看到多个 IPv6 地址。 | |||
这是正常的,因为 IPv6 允许同一个接口同时拥有多个地址。 | |||
=== 示例输出 === | |||
<code> | |||
ifconfig eth0 | |||
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 | |||
inet 172.16.8.37 netmask 255.255.252.0 broadcast 172.16.11.255 | |||
inet6 240e:32c:8d2d:f900::2e9/128 scopeid 0x0<global> | |||
inet6 240e:32c:8d2d:f900:be24:11ff:fe75:97aa/64 scopeid 0x0<global> | |||
inet6 fe80::be24:11ff:fe75:97aa/64 scopeid 0x20<link> | |||
inet6 240e:32c:8cfb:2500:be24:11ff:fe75:97aa/64 scopeid 0x0<global> | |||
... | |||
</code> | |||
=== 地址类型解释 === | |||
* '''240e:32c:8d2d:f900::2e9/128''' → 主机专用 IPv6 地址(点对点)。 | |||
* '''240e:32c:8d2d:f900:be24:11ff:fe75:97aa/64''' → 全球 IPv6 地址,由网卡 MAC 自动生成(SLAAC)。 | |||
* '''fe80::be24:11ff:fe75:97aa/64''' → 链路本地地址(Link-local),只在本链路内有效,用于路由邻居发现等。 | |||
* '''240e:32c:8cfb:2500:be24:11ff:fe75:97aa/64''' → 另一个由运营商下发的全球 IPv6 前缀(可能分配多个子网)。 | |||
=== 什么是 “全球直连” === | |||
* 所有标记为 '''<global>''' 的 IPv6 地址(如 240e::/64 开头)都是 '''全球单播地址'''。 | |||
* 意味着设备可以直接通过公网 IPv6 访问,无需 NAT 转换。 | |||
* 这就是所谓的 **“全球直连”** —— 每个设备都能在互联网上直接通信。 | |||
* 不像 IPv4 需要 NAT 才能共享公网 IP,IPv6 让每个设备都能拥有自己独立的公网地址。 | |||
=== 客户提示 === | |||
* 一个接口上有多个 IPv6 地址是正常现象。 | |||
* 只有 '''global''' 类型地址(例如 240e::/64)可以用于公网通信。 | |||
* '''link-local (fe80::/64)''' 地址仅用于本地链路内的通信,不会上公网。 | |||
* “全球直连” 表示设备已经在公网可见,因此需要合理配置防火墙,避免不必要的服务暴露。 | |||
== PPPoE and IPv6 Configuration Guide == | == PPPoE and IPv6 Configuration Guide == | ||
2025年9月15日 (一) 14:51的版本
PPPoE 与 IPv6 配置指南
WAN 接口设置 (http://172.16.0.1:8080/cgi-bin/luci/admin/network/network) WAN
- 进入 网络 → 接口 → WAN。
- 在 IPv6 设置中:
- 获取 IPv6 地址 → 手动 (在 PPP 链路上启用 IPv6 协商)。
- 委托 IPv6 前缀 → 启用。
- 教学说明
- WAN 是拨号接口,必须让 PPPoE 连接时顺便协商 IPv6 地址,并把上级分配的 IPv6 前缀传递下去,这样内网才能用到公网 IPv6。
WAN6 接口设置 (http://172.16.0.1:8080/cgi-bin/luci/admin/network/network) WAN6
- 进入 网络 → 接口 → WAN6。
- 设备选择 → pppoe-wan (原本默认为 eth0)。
- 教学说明
- WAN6 不是单独的物理口,而是跟随 PPPoE 拨号逻辑口。把它绑到 pppoe-wan 才能正确收发 IPv6 数据。
LAN 接口设置 (http://172.16.0.1:8080/cgi-bin/luci/admin/network/network) LAN
在 DHCPv6 相关配置中:
- RA 服务:混合模式
- DHCPv6 服务:混合模式
- NDP 代理:混合模式
- 教学说明
- LAN 要作为 IPv6 地址分配的服务器,把前缀通过 RA 和 DHCPv6 分发给局域网设备。混合模式的 NDP 可以同时兼容静态地址和 DHCPv6 分配。
为了保证 IPv6 入站访问正常,需要添加一条入站规则:
- 进入 网络 → 防火墙 → 自定义规则。
- 添加新规则:
- 名称:Allow-IPv6-Inbound
- 区域:wan
- 协议:IPv6
- 来源区域:wan
- 目标区域:device/lan
- 动作:ACCEPT
- 保存并应用。
- 教学说明
- 默认防火墙会拦截来自外部的 IPv6 流量。添加这条规则是为了让 IPv6 入站流量能通过,保证公网可以访问到内网设备(如服务器或 NAS)。
说明
- WAN 接口(pppoe-wan)负责拨号并启用 IPv6 协商。
- WAN6 接口绑定到 PPPoE 逻辑接口,而不是物理网口 eth0。
- LAN 接口通过 RA 和 DHCPv6 向内网设备下发 IPv6 地址和前缀。
- 防火墙规则确保外部 IPv6 流量可以按需进入 LAN/设备。
IPv6 地址说明
在查看接口(例如 eth0)时,可能会看到多个 IPv6 地址。 这是正常的,因为 IPv6 允许同一个接口同时拥有多个地址。
示例输出
ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.8.37 netmask 255.255.252.0 broadcast 172.16.11.255
inet6 240e:32c:8d2d:f900::2e9/128 scopeid 0x0<global>
inet6 240e:32c:8d2d:f900:be24:11ff:fe75:97aa/64 scopeid 0x0<global>
inet6 fe80::be24:11ff:fe75:97aa/64 scopeid 0x20<link>
inet6 240e:32c:8cfb:2500:be24:11ff:fe75:97aa/64 scopeid 0x0<global>
...
地址类型解释
- 240e:32c:8d2d:f900::2e9/128 → 主机专用 IPv6 地址(点对点)。
- 240e:32c:8d2d:f900:be24:11ff:fe75:97aa/64 → 全球 IPv6 地址,由网卡 MAC 自动生成(SLAAC)。
- fe80::be24:11ff:fe75:97aa/64 → 链路本地地址(Link-local),只在本链路内有效,用于路由邻居发现等。
- 240e:32c:8cfb:2500:be24:11ff:fe75:97aa/64 → 另一个由运营商下发的全球 IPv6 前缀(可能分配多个子网)。
什么是 “全球直连”
- 所有标记为 <global> 的 IPv6 地址(如 240e::/64 开头)都是 全球单播地址。
- 意味着设备可以直接通过公网 IPv6 访问,无需 NAT 转换。
- 这就是所谓的 **“全球直连”** —— 每个设备都能在互联网上直接通信。
- 不像 IPv4 需要 NAT 才能共享公网 IP,IPv6 让每个设备都能拥有自己独立的公网地址。
客户提示
- 一个接口上有多个 IPv6 地址是正常现象。
- 只有 global 类型地址(例如 240e::/64)可以用于公网通信。
- link-local (fe80::/64) 地址仅用于本地链路内的通信,不会上公网。
- “全球直连” 表示设备已经在公网可见,因此需要合理配置防火墙,避免不必要的服务暴露。
PPPoE and IPv6 Configuration Guide
WAN Interface (http://172.16.0.1:8080/cgi-bin/luci/admin/network/network) WAN
- Go to Network → Interfaces → WAN.
- Under IPv6 settings:
- Obtain IPv6 address → Manual (enable IPv6 negotiation on the PPP link).
- Delegate IPv6 prefix → Enable.
- Teaching Note
- The WAN interface is responsible for PPPoE dialing. You need to enable IPv6 negotiation here so the ISP provides an IPv6 prefix, which will then be delegated to the LAN.
WAN6 Interface (http://172.16.0.1:8080/cgi-bin/luci/admin/network/network) WAN6
- Go to Network → Interfaces → WAN6.
- Set device → pppoe-wan (instead of the default eth0).
- Teaching Note
- WAN6 is not a separate physical interface. It must follow the PPPoE logical interface (pppoe-wan) in order to properly send and receive IPv6 traffic.
LAN Interface (http://172.16.0.1:8080/cgi-bin/luci/admin/network/network) LAN
In the DHCPv6 settings:
- RA Service: Server mode
- DHCPv6 Service: Server mode
- NDP Proxy: Hybrid mode
- Teaching Note
- The LAN must act as the IPv6 prefix distributor. It does this by advertising addresses via RA (Router Advertisement) and DHCPv6. Hybrid NDP mode allows compatibility with both manually configured and dynamically assigned IPv6 addresses.
Firewall Rule (http://172.16.0.1:8080/cgi-bin/luci/admin/network/firewall/rules)
To allow inbound IPv6 traffic, add a firewall rule:
- Go to Network → Firewall → Custom Rules.
- Add a new rule:
- Name: Allow-IPv6-Inbound
- Zone: wan
- Protocol: IPv6
- Source zone: wan
- Destination zone: device/lan
- Action: ACCEPT
- Save and apply.
- Teaching Note
- By default, the firewall blocks inbound IPv6 traffic. This rule is needed to allow incoming IPv6 connections, for example if you want to expose a server or NAS to the internet.
Summary
- The WAN interface (pppoe-wan) handles PPPoE dialing and IPv6 negotiation with the ISP.
- The WAN6 interface must be bound to the PPPoE logical interface instead of the physical port.
- The LAN interface distributes IPv6 prefixes to clients via RA and DHCPv6.
- The firewall rule ensures inbound IPv6 traffic is accepted when required.