V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
OpenWrt 是一个专门面向嵌入式设备的 Linux 发行版。你可以将 OpenWrt 支持的型号的嵌入式设备,比如各种路由器上的系统,换成一个有更多可能性可以折腾的 Linux 系统。
OpenWrt 官方网站
FaiChou
V2EX  ›  OpenWrt

OpenWRT 如何向光猫请求一个指定前缀的 IPv6?

  •  
  •   FaiChou · 247 天前 · 1288 次点击
    这是一个创建于 247 天前的主题,其中的信息可能已经有所发展或是发生改变。

    光猫拨号后 ISP PD 一个 /60 的前缀给光猫,OpenWRT 连接光猫后 PD 获取到一个 /64 的前缀,但由于它作为路由器的上一级,获取到 /64 前缀是无法再向路由器 PD 的(没有子网可以划分了)。

    所以如何不动光猫的情况下,使 OpenWRT 请求一个 /60 /61 /62 /63 的前缀?

    我尝试过设置:

    $ cat /etc/config/network
    
    ...
    
    config interface 'WAN6'
            option proto 'dhcpv6'
            option ifname 'eth1'
            option reqaddress 'try'
            option reqprefix '61'
            option ip6prefix '62'
    

    但这个 reqprefix 不起作用,最终仍然是 /64 的前缀。

    RFC 3633 这段描述:

    If the requesting router includes an IA_PD Prefix option in the IA_PD option in its Solicit message, the delegating router MAY choose to use the information in that option to select the prefix(es) or prefix size to be delegated to the requesting router.

    也就是说 OpenWRT 的配置可以被光猫采纳,也可以不采纳。

    所以最终还是要登录超级管理员密码去修改光猫,或者将光猫改成桥接才可以?

    第 1 条附言  ·  247 天前
    问题解决了,将路由器改成了有线中继模式( AP )。

    这样所有设备+路由器+openwrt 都在同一个子网下。

    由于路由器仅作为 AP ,它自己不需要 IPv6 前缀。所有的 IPv6 地址分配工作都会由 OpenWRT 完成。
    2 条回复    2023-08-26 11:10:34 +08:00
    lovelylain
        1
    lovelylain  
       247 天前 via Android   ❤️ 1
    你这是光猫做主路由,openwrt 做二级路由,普通路由器做三级路由,不嫌路由层级多影响网速啊。可以试试在 openwrt 上折腾 ipv4 走 nat 但是 ipv6 走桥接,让三级路由直接从主路由获取 PD 前缀,需要的主要工具是 ebtables 。
    FaiChou
        2
    FaiChou  
    OP
       247 天前
    @lovelylain 哦我懂了,在 LAN 接口的 DHCP IPv6 设置中将“路由通告服务”和“DHCPv6 服务”改成中继。谢谢。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1299 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:41 · PVG 01:41 · LAX 10:41 · JFK 13:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.