V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
busier
V2EX  ›  宽带症候群

MikroTik RouterOS 无法获取 IPv6 前缀,只好做 NAT6 了

  •  
  •   busier · 78 天前 · 1285 次点击
    这是一个创建于 78 天前的主题,其中的信息可能已经有所发展或是发生改变。
    之前一直光猫桥接,获取 IPv6 前缀好好的,某天夜里电信不知道改完啥,就再也获取不到 IPv6 前缀了。网传是电信使用了不规范的 DUID 导致。但是死活找不到解决方法。

    今天重置了光猫,让光猫路由,光猫内对 IPv4 做了 DMZ 给 ROS 的 WAN 。

    IPv6 则打算手动折腾成 NAT6 。

    既然获取不到 IPv6 前缀,那就给 ROS WAN 口当作设备分配个 IPv6 地址吧。
    /ipv6 dhcp-client add add-default-route=yes interface=ether1 request=address

    给 LAN 侧网桥 bridge 分配个私有 IPv6 地址,我的 ROS7 默认是开启 Advertise 通告的。
    /ipv6 address add address=fd00::1 interface=bridge

    最后启用地址伪装,做好 NAT6 就可以了(我的 WAN 口 ether1 加入了 interface-list: WAN ,大家根据自己情况设定)
    /ipv6 firewall nat add action=masquerade chain=srcnat out-interface-list=WAN

    完成!这里我没有给客户机下发 DNS6 配置,这不是必要的,电信的 DNS4 服务器也可以应答 DNS6 的记录。

    最后记得优化下 ROS IPv6 的 MTU ,不然开了 IPv6 反而整体网络会变卡。
    第 1 条附言  ·  63 天前
    补充:RouterOS 拨号和光猫拨号两种情况下的 NAT6 做法 (前者配置完需要重拨 pppoe 或重启)

    #routeros pppoe dial
    /ipv6 settings set accept-router-advertisements=yes forward=yes

    /ipv6 address add address=dd00::1 advertise=yes interface=bridge

    /interface list add comment=defconf interface=pppoe-out1 list=WAN

    /ipv6 firewall nat add action=masquerade chain=srcnat out-interface-list=WAN

    ########## or #########

    #Fiber modem dial
    /ipv6 dhcp-client add add-default-route=yes interface=ether1 request=address

    /ipv6 address add address=dd00::1 advertise=yes interface=bridge

    /interface list add comment=defconf interface=ether1 list=WAN

    /ipv6 firewall nat add action=masquerade chain=srcnat out-interface-list=WAN
    13 条回复    2024-02-24 09:11:31 +08:00
    kaedeair
        1
    kaedeair  
       78 天前
    抓包看是啥问题,一般 pppoe 获得了 fe80 的本地链路地址会向 ff02::1:2 请求前缀
    busier
        2
    busier  
    OP
       78 天前
    @kaedeair 抓过的
    dhcp,debug,packet DHCPV6: -> serverid: 6660
    .............
    dhcp,debug DHCPV6: bad server DUID
    everfly
        3
    everfly  
       78 天前 via iPhone
    你这样分配的 ipv6 地址客户端大概率不会优先使用,可以把 fd00::1 换成这里的 ipv6 保留地址段之一: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
    Primovist
        4
    Primovist  
       75 天前 via iPhone
    前缀用的是/56 ?换/60 试试?
    yjzll
        5
    yjzll  
       75 天前
    上海电信+光猫拨号+openwrt+华为 AX3pro 的 AP ,ipv6+ipv4 正常,openwrt 配置是关键
    上海电信+光猫拨号+华为 AX3pro 的 AP ,ipv6+ipv4 正常
    上海电信+光猫拨号+华为 AX3pro 的路由器静态,开启 IPV6 自动,ipv6+ipv4 正常
    上海电信+光猫拨号+openwrt+华为 AX3pro 的的路由器静态,开启 IPV6 自动 ,ipv6+ipv4 正常,openwrt 配置是关键
    ping -6 openwrt 的 wan--ipv6 地址
    ping -6 www.baidu.com
    ,再测试下,注意顺序
    yjzll
        6
    yjzll  
       75 天前
    可以看看这里的配置顺序
    https://v2ex.com/t/1015180#reply11
    busier
        7
    busier  
    OP
       75 天前
    @Primovist 都试过的,不行
    busier
        8
    busier  
    OP
       75 天前
    @yjzll openwrt 是没问题的,这是 routeros 的问题,有人以及将此问题提交给拉脱维亚 mikrotik 了!
    neroxps
        9
    neroxps  
       75 天前 via iPhone
    @busier 按照 mikrotik 的尿性,这种问题不会解决。
    busier
        10
    busier  
    OP
       74 天前
    @neroxps 所以只好先 NAT6 用着了,反正也不再 IPv6 上运行服务器软件。
    busier
        11
    busier  
    OP
       70 天前 via iPhone
    @everfly 改用 dd00::段了,就可以优先使用 ipv6 了。
    que01
        12
    que01  
       70 天前
    唉 我不想折腾这个 我只想桥接模式下搞好这个 ipv6...当然是一样面临这个 duid 问题。。。
    busier
        13
    busier  
    OP
       63 天前
    @que01 已经补充桥接模式下 NAT6 做法
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2694 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 11:08 · PVG 19:08 · LAX 04:08 · JFK 07:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.