在此页面上
RIP 定时器
了解 RIP 定时器
RIP 会使用多个计时器来调节其操作。
更新间隔是 RIP 所学习的路由通告给邻路由的间隔。此计时器控制路由更新之间的间隔。默认情况下,更新间隔设置为 30 秒,重置计时器时会添加一点随机时间。这样,当所有路由设备同时更新其邻设备时,就可以防止拥塞。
要配置更新时间间隔,请包含 update-interval
语句:
update-interval seconds;
seconds 可以是 10 到 60 的值。
您可以设置路由超时间隔。如果路由在按指定的时间间隔安装在路由表中后不刷新,则路由标记为无效,在保留期到期后从路由表中移除。
要配置 RIP 的路由超时,请包含 route-timeout
以下语句:
route-timeout seconds;
seconds 可以是 30 到 360 的值。默认值为 180 秒。
当满足路由超时限制或路由度量达到无限范围且路由不再有效时,RIP 路由到期。但是,已过期的路由将在路由表中保留指定的时间段,以便可以通知邻方已放弃路由。通过配置停止计时器设置此时间段。当停止计时器到期时,路由将从路由表中移除。
要配置 RIP 的停止计时器,请包含 holddown
以下语句:
holddown seconds;
seconds 可以是 10 到 180 的值。默认值为 120 秒。
在 Junos OS 11.1 和更高版本中,RIP 需求电路会提供重新传输计时器。
通常,我们建议更改 RIP 定时器,除非更改的影响十分明确。路由超时应至少是更新间隔的三倍。通常,默认值最适合标准操作。
示例:配置 RIP 定时器
此示例说明了如何配置 RIP 更新间隔以及如何监控更改的影响。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
在此例中,设备 R2 的邻接设备 R1 更新间隔为 60 秒,其邻接设备 R3 的更新间隔为 10 秒。
此示例不一定实用,但展示用于演示目的。通常,我们建议更改 RIP 定时器,除非更改的影响十分明确。通常,默认值最适合标准操作。
还会显示导出策略,因为作为 RIP 最低配置的一部分需要导出策略。
图 1 显示了此示例中使用的拓扑。

CLI 快速配置 显示了图 1中所有设备的配置。本部分 #d165e62__d165e183 设备 R2 的步骤。
拓扑
配置
程序
CLI快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以匹配网络配置,然后将命令复制并粘贴到 层次结构级别的 CLI 中 [edit]
。
设备 R1
set interfaces fe-1/2/0 unit 1 family inet address 10.0.0.1/30 set interfaces lo0 unit 1 family inet address 172.16.0.1/32 set interfaces lo0 unit 1 family inet address 192.168.1.1/32 set protocols rip group rip-group export advertise-routes-through-rip set protocols rip group rip-group neighbor fe-1/2/0.1 set policy-options policy-statement advertise-routes-through-rip term 1 from protocol direct set policy-options policy-statement advertise-routes-through-rip term 1 from protocol rip set policy-options policy-statement advertise-routes-through-rip term 1 then accept
设备 R2
set interfaces fe-1/2/0 unit 2 family inet address 10.0.0.2/30 set interfaces fe-1/2/1 unit 5 family inet address 10.0.0.5/30 set interfaces lo0 unit 2 family inet address 192.168.2.2/32 set interfaces lo0 unit 2 family inet address 172.16.2.2/32 set protocols rip group rip-group export advertise-routes-through-rip set protocols rip group rip-group neighbor fe-1/2/0.2 update-interval 60 set protocols rip group rip-group neighbor fe-1/2/1.5 update-interval 10 set policy-options policy-statement advertise-routes-through-rip term 1 from protocol direct set policy-options policy-statement advertise-routes-through-rip term 1 from protocol rip set policy-options policy-statement advertise-routes-through-rip term 1 then accept
设备 R3
set interfaces fe-1/2/0 unit 6 family inet address 10.0.0.6/30 set interfaces lo0 unit 3 family inet address 192.168.3.3/32 set interfaces lo0 unit 3 family inet address 172.16.3.3/32 set protocols rip group rip-group export advertise-routes-through-rip set protocols rip group rip-group neighbor fe-1/2/0.6 set policy-options policy-statement advertise-routes-through-rip term 1 from protocol direct set policy-options policy-statement advertise-routes-through-rip term 1 from protocol rip set policy-options policy-statement advertise-routes-through-rip term 1 then accept
逐步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航指南CLI,请参阅 CLI 用户 指南 中的 在配置模式下CLI 编辑器。
要配置 RIP 更新间隔时间:
配置网络接口。
此示例显示了用于模拟附加网络的多个环路接口地址。
[edit interfaces] user@R2# set fe-1/2/0 unit 2 family inet address 10.0.0.2/30 user@R2# set fe-1/2/1 unit 5 family inet address 10.0.0.5/30 user@R2# set lo0 unit 2 family inet address 192.168.2.2/32 user@R2# set lo0 unit 2 family inet address 172.16.2.2/32
为两个 RIP 邻设备配置不同的更新间隔。
要Junos OS RIP,必须配置一个包含启用 RIP 的接口的组。不需要在环路接口上启用 RIP。
[edit protocols rip group rip-group] user@R2# set neighbor fe-1/2/0.2 update-interval 60 user@R2# set neighbor fe-1/2/1.5 update-interval 10
创建路由策略以通告直接路由和 RIP 学习的路由。
[edit policy-options policy-statement advertise-routes-through-rip term 1] user@R2# set from protocol direct user@R2# set from protocol rip user@R2# set then accept
应用路由策略。
在这种情况下Junos OS,只能在组级别应用 RIP 导出策略。
[edit protocols rip group rip-group] user@R2# set export advertise-routes-through-rip
结果
在配置模式下,输入 、 和 show interfaces
命令 show protocols
以确认您的 show policy-options
配置。如果输出未显示预期的配置,请重复此示例中的配置说明进行更正。
user@R2# show interfaces
fe-1/2/0 {
unit 2 {
family inet {
address 10.0.0.2/30;
}
}
}
fe-1/2/1 {
unit 5 {
family inet {
address 10.0.0.5/30;
}
}
}
lo0 {
unit 2 {
family inet {
address 192.168.2.2/32;
address 172.16.2.2/32;
}
}
}
user@R2# show protocols
rip {
group rip-group {
export advertise-routes-through-rip;
neighbor fe-1/2/0.2 {
update-interval 60;
}
neighbor fe-1/2/1.5 {
update-interval 10;
}
}
}
user@R2# show policy-options
policy-statement advertise-routes-through-rip {
term 1 {
from protocol [ direct rip ];
then accept;
}
}
如果完成设备配置,请在配置 模式下输入 commit 。
验证
确认配置工作正常。
检查设备 R2 发送的 RIP 更新
目的
确保 RIP 更新数据包以预期时间间隔发送。
行动
在操作模式下,输入 show rip statistics
命令。
user@R2> show rip statistics RIPv2 info: port 520; holddown 120s. rts learned rts held down rqsts dropped resps dropped 4 2 0 0 fe-1/2/0.2: 2 routes learned; 5 routes advertised; timeout 180s; update interval 60s Counter Total Last 5 min Last minute ------- ----------- ----------- ----------- Updates Sent 123 5 1 Triggered Updates Sent 0 0 0 Responses Sent 0 0 0 Bad Messages 0 0 0 RIPv1 Updates Received 0 0 0 RIPv1 Bad Route Entries 0 0 0 RIPv1 Updates Ignored 0 0 0 RIPv2 Updates Received 244 10 2 RIPv2 Bad Route Entries 0 0 0 RIPv2 Updates Ignored 0 0 0 Authentication Failures 0 0 0 RIP Requests Received 0 0 0 RIP Requests Ignored 0 0 0 none 0 0 0 fe-1/2/1.5: 2 routes learned; 5 routes advertised; timeout 180s; update interval 10s Counter Total Last 5 min Last minute ------- ----------- ----------- ----------- Updates Sent 734 32 6 Triggered Updates Sent 0 0 0 Responses Sent 0 0 0 Bad Messages 0 0 0 RIPv1 Updates Received 0 0 0 RIPv1 Bad Route Entries 0 0 0 RIPv1 Updates Ignored 0 0 0 RIPv2 Updates Received 245 11 2 RIPv2 Bad Route Entries 0 0 0 RIPv2 Updates Ignored 0 0 0 Authentication Failures 0 0 0 RIP Requests Received 0 0 0 RIP Requests Ignored 0 0 0 none 0 0 0
意义
更新 间隔 字段显示邻接者 R1 的间隔为 60 秒,邻接者 R3 的间隔为 10 秒。更新 已发送 字段显示设备 R2 向设备 R1 发送更新的速率约为向设备 R3 发送更新的 1/6。
检查设备 R2 收到的 RIP 更新
目的
确保 RIP 更新数据包以预期时间间隔发送。
行动
在操作模式下,输入 show rip statistics
命令。
user@R1> show rip statistics RIPv2 info: port 520; 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 312 10 2 Triggered Updates Sent 2 0 0 Responses Sent 0 0 0 Bad Messages 0 0 0 RIPv1 Updates Received 0 0 0 RIPv1 Bad Route Entries 0 0 0 RIPv1 Updates Ignored 0 0 0 RIPv2 Updates Received 181 5 1 RIPv2 Bad Route Entries 0 0 0 RIPv2 Updates Ignored 0 0 0 Authentication Failures 0 0 0 RIP Requests Received 1 0 0 RIP Requests Ignored 0 0 0 none 0 0 0
意义
"RIPv2 更新 已接收"字段显示从设备 R2 接收的更新数量。
检查设备 R3 收到的 RIP 更新
目的
确保 RIP 更新数据包以预期时间间隔发送。
行动
在操作模式下,输入 show rip statistics
命令。
user@R3> show rip statistics RIPv2 info: port 520; holddown 120s. rts learned rts held down rqsts dropped resps dropped 5 0 0 0 fe-1/2/0.6: 5 routes learned; 2 routes advertised; timeout 180s; update interval 30s Counter Total Last 5 min Last minute ------- ----------- ----------- ----------- Updates Sent 314 11 2 Triggered Updates Sent 1 0 0 Responses Sent 0 0 0 Bad Messages 0 0 0 RIPv1 Updates Received 0 0 0 RIPv1 Bad Route Entries 0 0 0 RIPv1 Updates Ignored 0 0 0 RIPv2 Updates Received 827 31 6 RIPv2 Bad Route Entries 0 0 0 RIPv2 Updates Ignored 0 0 0 Authentication Failures 0 0 0 RIP Requests Received 0 0 0 RIP Requests Ignored 0 0 0 none 0 0 0
意义
"RIPv2 更新 已接收"字段显示从设备 R2 接收的更新数量。