基本 RIPng 配置
了解基本 RIPng 路由
默认情况下,不会重新分发 RIP 下一代 (RIPng) 路由。您必须配置导出策略才能重新分发 RIPng 路由。
要让路由器与其他路由器交换路由,必须配置 RIPng 组和邻居。从未配置为 RIPng 邻居的路由器接收的 RIPng 路由将被忽略。同样,RIPng 路由仅向配置为 RIPng 邻居的路由器播发。
示例:配置基本 RIPng 网络
此示例说明如何配置基本 RIPng 网络。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
在此示例中,您将配置基本 RIPng 网络,创建一个名为 ripng-group 的 RIPng 组,并将直连接口添加到 RIPng 组。然后,您将路由策略配置为使用策略语句 通告路由通过翻录通告直接路由。
默认情况下,Junos OS 不会通告 RIPng 路由,甚至不会播发通过 RIPng 获知的路由。要播发 RIPng 路由,您必须配置并应用播发 RIPng 学习路由和直接路由的导出路由策略。
要在设备上使用 RIPng,必须在网络中的所有 RIPng 接口上配置 RIPng。 图 1 显示了此示例中使用的拓扑。
CLI 快速配置 显示了 图 1 中所有设备的配置。 #d10e63__d10e187 部分介绍了设备 R1 上的步骤。
拓扑学
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改与您的网络配置匹配所需的任何详细信息,然后将命令复制并粘贴到层次结构级别的 CLI [edit]
中。
设备 R1
set interfaces fe-1/2/0 unit 1 description to-R2 set interfaces fe-1/2/0 unit 1 family inet6 address 2001:db8:0:1::/64 eui-64 set interfaces lo0 unit 1 family inet6 address 2001:db8::1/128 set protocols ripng group ripng-group export advertise-routes-through-ripng set protocols ripng group ripng-group neighbor fe-1/2/0.1 set policy-options policy-statement advertise-routes-through-ripng term 1 from protocol direct set policy-options policy-statement advertise-routes-through-ripng term 1 from protocol ripng set policy-options policy-statement advertise-routes-through-ripng term 1 then accept
设备 R2
set interfaces fe-1/2/0 unit 2 description to-R1 set interfaces fe-1/2/0 unit 2 family inet6 address 2001:db8:0:2::/64 eui-64 set interfaces fe-1/2/1 unit 5 description to-R3 set interfaces fe-1/2/1 unit 5 family inet6 address 2001:db8:0:3::/64 eui-64 set interfaces lo0 unit 2 family inet6 address 2001:db8::2/128 set protocols ripng group ripng-group export advertise-routes-through-ripng set protocols ripng group ripng-group neighbor fe-1/2/0.2 set protocols ripng group ripng-group neighbor fe-1/2/1.5 set policy-options policy-statement advertise-routes-through-ripng term 1 from protocol direct set policy-options policy-statement advertise-routes-through-ripng term 1 from protocol ripng set policy-options policy-statement advertise-routes-through-ripng term 1 then accept
设备 R3
set interfaces fe-1/2/0 unit 6 description to-R2 set interfaces fe-1/2/0 unit 6 family inet6 address 2001:db8:0:4::/64 eui-64 set interfaces lo0 unit 3 family inet6 address 2001:db8::3/128 set protocols ripng group ripng-group export advertise-routes-through-ripng set protocols ripng group ripng-group neighbor fe-1/2/0.6 set policy-options policy-statement advertise-routes-through-ripng term 1 from protocol direct set policy-options policy-statement advertise-routes-through-ripng term 1 from protocol ripng set policy-options policy-statement advertise-routes-through-ripng term 1 then accept
分步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置基本 RIPng 网络,请执行以下操作:
配置网络接口。
使用该
eui-64
语句自动生成接口地址的主机部分和链路本地地址。对于环路接口,必须分配一个 128 位地址。
[edit interfaces] user@R1# set fe-1/2/0 unit 1 description to-R2 user@R1# set fe-1/2/0 unit 1 family inet6 address 2001:db8:0:1::/64 eui-64 user@R1# set lo0 unit 1 family inet6 address 2001:db8::1/128
创建 RIPng 组并添加接口。
要在 Junos OS 中配置 RIPng,必须配置一个包含启用 RIPng 的接口的组。您无需在环路接口上启用 RIPng。
[edit protocols ripng group ripng-group] user@R1# set neighbor fe-1/2/0.1
创建路由策略以通告直接路由和 RIPng 获知的路由。
[edit policy-options policy-statement advertise-routes-through-ripng term 1] user@R1# set from protocol direct user@R1# set from protocol ripng user@R1# set then accept
应用路由策略。
在 Junos OS 中,只能在组级别应用 RIPng 导出策略。
[edit protocols ripng group ripng-group] user@R1# set export advertise-routes-through-ripng
结果
在配置模式下,输入 show interfaces
、 show protocols
和 show policy-options
命令确认您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明以进行更正。
user@R1# show interfaces
fe-1/2/0 {
unit 1 {
description to-R2;
family inet6 {
address 2001:db8:0:1::/64 {
eui-64;
}
}
}
}
lo0 {
unit 1 {
family inet6 {
address 2001:db8::1/128;
}
}
}
user@R1# show protocols
ripng {
group ripng-group {
export advertise-routes-through-ripng;
neighbor fe-1/2/0.1;
}
}
user@R1# show policy-options
policy-statement advertise-routes-through-ripng {
term 1 {
from protocol [ direct ripng ];
then accept;
}
}
如果完成设备配置,请从配置模式输入 提交 。
验证
确认配置工作正常。
- 检查路由表
- 检查接口地址
- 查看设备 R1 播发到设备 R2 的路由
- 验证启用 RIPng 的接口
- 查看设备 R1 从设备 R2 接收的路由
- 验证 RIPng 消息的交换
- 验证 RIPng 网络中所有主机的可访问性
检查路由表
目的
验证路由表是否填充了预期的路由。
行动
在操作模式下,输入 show route protocol ripng
命令。
user@R1> show route protocol ripng inet6.0: 12 destinations, 12 routes (12 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 2001:db8::2/128 *[RIPng/100] 3d 19:24:43, metric 2, tag 0 > to fe80::2a0:a514:0:24c via fe-1/2/0.1 2001:db8::3/128 *[RIPng/100] 3d 19:24:40, metric 3, tag 0 > to fe80::2a0:a514:0:24c via fe-1/2/0.1 2001:db8:0:2::/64 *[RIPng/100] 3d 19:24:43, metric 2, tag 0 > to fe80::2a0:a514:0:24c via fe-1/2/0.1 2001:db8:0:3::/64 *[RIPng/100] 3d 19:24:43, metric 2, tag 0 > to fe80::2a0:a514:0:24c via fe-1/2/0.1 2001:db8:0:4::/64 *[RIPng/100] 3d 19:24:40, metric 3, tag 0 > to fe80::2a0:a514:0:24c via fe-1/2/0.1 ff02::9/128 *[RIPng/100] 3d 19:24:47, metric 1 MultiRecv
意义
输出显示已从设备 R2 和设备 R3 获知路由。
如果要在设备 R2 上的路由策略中删除 从协议翻录 条件,则不会在设备 R1 上获知来自设备 R3 的远程路由。
检查接口地址
目的
验证语句是否 eui-64
自动生成了接口地址的主机部分和链路本地地址。
行动
在操作模式下,输入 show interfaces terse
命令。
user@R1> show interfaces terse Interface Admin Link Proto Local Remote fe-1/2/0 fe-1/2/0.1 up up inet6 2001:db8:0:1:2a0:a514:0:14c/64 fe80::2a0:a514:0:14c/64 lo0 lo0.1 up up inet6 2001:db8::1 fe80::2a0:a50f:fc56:14c
意义
输出显示 fe-1/2/0.1 上的接口地址包括网络部分 (2001:db8:0:1) 和主机部分 (2a0:a514:0:14c)。
此外,链路本地 (fe80) 地址会分配给接口 fe-1/2/0.1 和 lo0.1。
查看设备 R1 播发到设备 R2 的路由
目的
验证设备 R1 是否正在发送预期的路由。
行动
在操作模式下,输入 show route advertising-protocol ripng
命令,使用设备 R1 的链路本地地址作为邻居地址。
user@R1> show route advertising-protocol ripng fe80::2a0:a514:0:14c inet6.0: 12 destinations, 12 routes (12 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 2001:db8::1/128 *[Direct/0] 3d 19:45:55 > via lo0.1 2001:db8:0:1::/64 *[Direct/0] 3d 19:45:55 > via fe-1/2/0.1
意义
设备 R1 正在向其直连网络发送路由。
验证启用 RIPng 的接口
目的
验证所有启用 RIPng 的接口是否都可用且处于活动状态。
行动
在操作模式下,输入 show ripng neighbor
命令。
user@R1> show ripng neighbor Source Dest In Neighbor State Address Address Send Recv Met -------- ----- ------- ------- ---- ---- --- fe-1/2/0.1 Up fe80::2a0:a514:0:14c ff02::9 yes yes 1
意义
输出显示设备 R1 上启用了 RIPng 的接口正在运行。
输出还显示分配给设备 R2 直接连接的链路本地接口的链路本地地址。
通常,对于此命令,输出会显示设备上配置的 RIPng 邻居的列表。验证以下信息:
每个配置的接口都存在。接口按字母顺序列出。
每个配置的接口都已启动。接口的状态列在“状态”列中。状态为 Up 表示链路正在传递 RIPng 流量。Dn 状态表示链路未传递 RIPng 流量。在点对点链路中,此状态通常表示终结点未配置为 RIPng,或者链路不可用。
查看设备 R1 从设备 R2 接收的路由
目的
验证设备 R1 是否正在接收预期的路由。
行动
在操作模式下,输入 show route receive-protocol ripng
命令,使用设备 R2 的直接连接链路本地接口地址作为邻居地址。
user@R1> show route receive-protocol ripng fe80::2a0:a514:0:24c inet6.0: 12 destinations, 12 routes (12 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 2001:db8::2/128 *[RIPng/100] 3d 19:58:09, metric 2, tag 0 > to fe80::2a0:a514:0:24c via fe-1/2/0.1 2001:db8::3/128 *[RIPng/100] 3d 19:58:06, metric 3, tag 0 > to fe80::2a0:a514:0:24c via fe-1/2/0.1 2001:db8:0:2::/64 *[RIPng/100] 3d 19:58:09, metric 2, tag 0 > to fe80::2a0:a514:0:24c via fe-1/2/0.1 2001:db8:0:3::/64 *[RIPng/100] 3d 19:58:09, metric 2, tag 0 > to fe80::2a0:a514:0:24c via fe-1/2/0.1 2001:db8:0:4::/64 *[RIPng/100] 3d 19:58:06, metric 3, tag 0 > to fe80::2a0:a514:0:24c via fe-1/2/0.1
意义
设备 R1 从设备 R2 接收设备 R2 的所有直连网络。设备 R1 还从设备 R2 接收设备 R3 的所有直连网络,设备 R2 通过 RIPng 从设备 R3 获知这些网络。
验证 RIPng 消息的交换
目的
验证是否在所有启用 RIPng 的接口上发送和接收 RIPng 消息。
行动
在操作模式下,输入 show ripng statistics
命令。
user@R1> show ripng statistics RIPng info: port 521; holddown 120s. rts learned rts held down rqsts dropped resps dropped 5 0 0 0 fe-1/2/0.1: 5 routes learned; 2 routes advertised; timeout 180s; update interval 30s Counter Total Last 5 min Last minute ------- ----------- ----------- ----------- Updates Sent 11632 10 2 Triggered Updates Sent 0 0 0 Responses Sent 0 0 0 Bad Messages 0 0 0 Updates Received 11634 11 2 Bad Route Entries 0 0 0 Updates Ignored 0 0 0 RIPng Requests Received 1 0 0 RIPng Requests Ignored 0 0 0
意义
输出显示获知的 RIPng 路由数。它还显示在启用 RIPng 的接口上发送和接收的 RIPng 更新的数量。验证以下信息:
获知的 RIPng 路由数与获知的预期路由数匹配。通过传出接口直接连接获知的子网不会列为 RIPng 路由。
RIPng 更新将在每个启用 RIPng 的接口上发送。如果未发送更新,则路由策略可能未配置为导出路由。
每个启用 RIPng 的接口上都会收到 RIPng 更新。如果未收到任何更新,则路由策略可能未配置为导出连接到该子网的主机上的路由。缺少更新也可能表示身份验证错误。
验证 RIPng 网络中所有主机的可访问性
目的
通过对网络中的每个环路地址使用 traceroute 命令,验证是否可以从每个瞻博网络设备访问 RIPng 网络中的所有主机。
行动
在操作模式下,输入 traceroute
命令。
user@R1> traceroute 2001:db8::3 traceroute6 to 2001:db8::3 (2001:db8::3) from 2001:db8:0:1:2a0:a514:0:14c, 64 hops max, 12 byte packets 1 2001:db8:0:2:2a0:a514:0:24c (2001:db8:0:2:2a0:a514:0:24c) 8.881 ms 1.175 ms 1.101 ms 2 2001:db8::3 (2001:db8::3) 1.544 ms 2.445 ms 2.043 ms
意义
输出中的每个编号行都指示主机路径中的一个路由跃点。三次增量表示设备与每个 traceroute 数据包的跃点之间的往返时间 (RTT)。
要确保 RIPng 网络正常运行,请验证以下信息:
列表中的最后一个跃点是要到达的主机。
到主机的预期跃点数与 traceroute 输出中的跃点数匹配。如果输出中出现的跃点数多于预期,则表明某个网段可能无法访问。它还可能表示意外设置了一个或多个主机上的传入或传出衡量指标。