在 Mikrotik RouterOS v7.x 上配置 IPv6## 0. 简介Mikrotik RouterOS 上的 IPv6 配置比 ASUS 上的 Merlin 复杂得多。我们将在本文中配置 IPv6。
配置基于 Mikrotik RouterOS 7.6。
1. 配置 DHCPv6 客户端使用以下命令登录 RouterOS 中的终端:```
Section titled “1. 配置 DHCPv6 客户端使用以下命令登录 RouterOS 中的终端:```”Accept ISP RA, Get IPv6 Address with SLAAC
Section titled “Accept ISP RA, Get IPv6 Address with SLAAC”/ipv6 settings set accept-router-advertisements=yes
Configure DHCPv6 client:
Section titled “Configure DHCPv6 client:”- Add default route: yes
Section titled “- Add default route: yes”- WAN interface: pppoe-ether1
Section titled “- WAN interface: pppoe-ether1”- IPv6 address pool: IPv6 (You can change to whatever you want)
Section titled “- IPv6 address pool: IPv6 (You can change to whatever you want)”- Prefix length for DHCPv6 server’s offering cascading routers: 60
Section titled “- Prefix length for DHCPv6 server’s offering cascading routers: 60”- Request LAN prefix from ISP
Section titled “- Request LAN prefix from ISP”/ipv6 dhcp-client add add-default-route=no interface=pppoe-ether1 \
pool-name=IPv6 pool-prefix-length=60
request=prefix
江苏南京移动提供/60前缀,如果前缀长度小于/63,则无法使用DHCPv6。## 2.添加必要的IPv6防火墙规则```# Accept DHCPv6 client prefix delegation/ipv6 firewall filter add action=accept chain=input \ comment="Accept DHCPv6 client prefix delegation" \ dst-port=546 protocol=udp src-address=fe80::/10如果您使用默认脚本配置了路由器,则此规则是默认的。
3. 为接口分配IPv6地址```
Section titled “3. 为接口分配IPv6地址```”/ipv6 address add address=::1 from-pool=IPv6 interface=bridge
## 4.配置DHCPv6-PD服务器```# Delegate IPv6 addresses from pool `delegation`# Lease is valid for 1 day/ipv6 dhcp-server add address-pool=IPv6 \ interface=bridge lease-time=7d name=Home-IPv6