Route(IPv6 路由)

来自深圳捷联讯通科技有限公司
跳转至: 导航搜索
操作路径:/ipv6 route


IPv6 路由配置和 IPv4 一样,通过添加默认网关指定默认路由,都是在 route 菜单下


33..9.jpg


对于静态路由,基本配置与 IPv4 相同,下面是一个简单的 ipv6 添加目标静态路由的配置实例:
[admin@MikroTik] > ipv6 route add dst-address=2001::/16 gateway=fc00:dead:beef::2
[admin@MikroTik] > ipv6 route print detail
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, o - ospf, b - bgp, U - unreachable
0 A S dst-address=2001::/16 gateway=fc00:dead:beef::2 reachable ether1 distance=1 scope=30 
target-scope=10


ipv4 和 ipv6 最显著的区别是,如果接口被指定,链路本地地址也可以用作路由下一跳网关:
[admin@MikroTik] > ipv6 route add dst-address=2002::/16 gateway=fe80::21a:4dff:fe56:1f4d%ether1
[admin@MikroTik] > ipv6 route print detail
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, o - ospf, b - bgp, U - unreachable
...
1 A S dst-address=2002::/16
      gateway=fe80::21a:4dff:fe56:1f4d%ether1 reachable distance=1
      scope=30 target-scope=10


另一个小的区别是,没有黑洞或禁止路由,只有 unreachable(无法到达)。
下面的事例,是达到相同的目标地址,通过不同的接口,在一条路由规则配置多条网关:
[admin@MikroTik] > ipv6 address p
Flags: X - disabled, I - invalid, D - dynamic, G - global, L - link-local
#        ADDRESS               INTERFACE        ADVERTISE
0    G fc00:1::1/64             ether1              no
1    G fc00:2::1/64             ether2              no
[admin@MikroTik] > ipv6 route add dst-address=2001::/16 gateway=fc00:1::2,fc00:2::2
[admin@MikroTik] > ipv6 route print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, o - ospf, b - bgp, U - unreachable
#              DST-ADDRESS                GATEWAY                  DISTANCE
0             A S 2001::/16     fc00:2::2 reachable ether1, 1
                                fc00:1::2 reachable ether2


RouterOS 通过一条规则完成多网关配置,对于 linux 内核而言,并非在同一条规则完成,而是通过多条规则实现,当我们查看
linux 内核路由表时,看到如下:
# ip -6 route
2001::/16 via fc00:2::2 dev eth1 proto static metric 1024 mtu 1500 advmss 1440 metric10 4294967295
2001::/16 via fc00:1::2 dev eth0 proto static metric 1024 mtu 1500 advmss 1440 metric10 4294967295
...