本页内容
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 及更高版本中,RE 传输计时器可用于 RIP 需求电路。
通常,我们建议反对更改 RIP 计时器,除非更改的影响已得到充分理解。路由超时应至少是更新间隔的三倍。通常,对于标准操作,最好保留默认值。
示例:配置 RIP 计时器
此示例说明如何配置 RIP 更新间隔以及如何监控更改的影响。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
在此示例中,设备 R2 的邻接方设备 R1 的更新间隔为 60 秒,其邻接方设备 R3 的更新间隔为 10 秒。
此示例不一定实用,但出于演示目的而展示。通常,我们建议反对更改 RIP 计时器,除非更改的影响已得到充分理解。通常,对于标准操作,最好保留默认值。
同时显示导出策略,因为需要导出策略作为 RIP 的最低配置的一部分。
图 1 显示了此示例中使用的拓扑。
CLI 快速配置 显示了 图 1 中所有设备的配置。 第 #d69e62__d69e183 节介绍了设备 R2 上的步骤。
拓扑
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 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 protocols
和show policy-options
命令,show interfaces
以确认您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
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;
}
}
完成设备配置后,请在配置模式下输入 提交 。
验证
确认配置工作正常。
检查设备 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 接收的更新数。