示例:配置 IS-IS 接口上 CSNP 数据包的传输频率
此示例说明如何修改 IS-IS 接口上的完整序列号 PDU (CSNP) 间隔。
要求
开始之前,配置 IS-IS。有关示例 IS-IS 配置的信息 ,请参阅示例:配置 IS-IS 。
概述
CSNP 包含 IS-IS 数据库中所有链路状态 PDU 的完整列表。CSNP 在所有链路上定期发送,接收系统使用 CSNP 中的信息来更新和同步其链路状态 PDU 数据库。指定的路由器在广播链路上组播 CSNP,而不是为每个链路状态 PDU 发送显式确认。
如果路由设备是 LAN 上的指定路由器,则 IS-IS 每 10 秒发送一次 CSNP。您可能需要修改默认间隔以防止 CSNP 泛洪。
csnp-interval该语句仅在 LAN 接口上配置时有效。
要修改 CSNP 间隔,请包含以下 csnp-interval 语句:
csnp-interval seconds;
时间范围为 1 到 65,535 秒。
要将接口配置为不发送任何 CSNP,请指定 disable 选项:
csnp-interval disable;
在此示例中,LAN 分段上的 IS-IS 路由设备配置为每 30 秒发送一次 CSNP。
图 1 显示了此示例中使用的拓扑。
此示例介绍设备 R1 上的步骤。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层 [edit] 级的 CLI 中。
设备 R1
set interfaces fe-1/2/0 unit 0 description to-R2 set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.1/30 set interfaces fe-1/2/0 unit 0 family iso set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0001.00 set protocols isis traceoptions file isis-trace set protocols isis traceoptions flag csn set protocols isis interface fe-1/2/0.0 csnp-interval 30 set protocols isis interface lo0.0
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置 CSNP 间隔,请执行以下作:
配置接口。
[edit interfaces] user@R1# set fe-1/2/0 unit 0 description to-R2 user@R1# set fe-1/2/0 unit 0 family inet address 10.0.0.1/30 user@R1# set fe-1/2/0 unit 0 family iso user@R1# set lo0 unit 0 family inet address 192.168.0.1/32 user@R1# set lo0 unit 0 family iso address 49.0002.0192.0168.0001.00
在接口上启用 IS-IS。
[edit protocols isis] user@R1# set interface fe-1/2/0.0 user@R1# set interface lo0.0
修改 CSNP 间隔。
[edit protocols isis interface fe-1/2/0.0] user@R1# set csnp-interval 30
(选答)启用跟踪以跟踪 CSNP作。
[edit protocols isis traceoptions] user@R1# set file isis-trace user@R1# set flag csn
结果
在配置模式下,输入 show interfaces 和 show protocols 命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R1# show interfaces
fe-1/2/0 {
unit 0 {
description to-R2;
family inet {
address 10.0.0.1/30;
}
family iso;
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.1/32;
}
family iso {
address 49.0002.0192.0168.0001.00;
}
}
}
user@R1# show protocols
isis {
traceoptions {
file isis-trace;
flag csn;
}
interface fe-1/2/0.0 {
csnp-interval 30;
}
interface lo0.0;
}
如果完成设备配置,请从配置模式输入 commit 。在设备 R2 上重复配置。
验证
确认配置工作正常。
验证 CSNP 间隔
目的
检查 IS-IS 接口上的 CSNP 间隔设置。
行动
在作模式下,输入 show isis interface extensive 命令。
user@R1> show isis interface extensive
IS-IS interface database:
fe-1/2/0.0
Index: 70, State: 0x6, Circuit id: 0x1, Circuit type: 3
LSP interval: 100 ms, CSNP interval: 30 s, Loose Hello padding
Adjacency advertisement: Advertise
Level 1
Adjacencies: 1, Priority: 64, Metric: 10
Hello Interval: 9.000 s, Hold Time: 27 s
Designated Router: R2.02 (not us)
Level 2
Adjacencies: 1, Priority: 64, Metric: 10
Hello Interval: 9.000 s, Hold Time: 27 s
Designated Router: R2.02 (not us)
意义
输出显示 CSNP 间隔设置为 30 秒。
检查 CSNP 统计信息
目的
检查发送和接收的 CSNP 数量。
行动
在作模式下,输入 show isis statistics 命令。
user@R1> show isis statistics IS-IS statistics for R1: PDU type Received Processed Drops Sent Rexmit LSP 5 5 0 3 0 IIH 94 20 0 43 0 CSNP 6 6 0 0 0 PSNP 0 0 0 0 0 Unknown 0 0 0 0 0 Totals 105 31 0 46 0 Total packets received: 105 Sent: 46 SNP queue length: 0 Drops: 0 LSP queue length: 0 Drops: 0 SPF runs: 5 Fragments rebuilt: 5 LSP regenerations: 0 Purges initiated: 0 -----
user@R2> show isis statistics IS-IS statistics for R2: PDU type Received Processed Drops Sent Rexmit LSP 3 3 0 5 0 IIH 35 11 0 86 0 CSNP 0 0 0 6 0 PSNP 0 0 0 0 0 Unknown 0 0 0 0 0 Totals 38 14 0 97 0 Total packets received: 38 Sent: 97 SNP queue length: 0 Drops: 0 LSP queue length: 0 Drops: 0 SPF runs: 7 Fragments rebuilt: 7 LSP regenerations: 0 Purges initiated: 0
意义
输出显示在设备 R1 和设备 R2 上发送和接收的 CSNP 数。
在广播链路上,只有指定的中间系统 (DIS) 发送 CSNP。
检查 IS-IS 日志
目的
检查 IS-IS 跟踪日志,查看数据包之间的间隔。
行动
在作模式下,输入 show log isis-trace | match csn 命令。
user@R1> show log isis-trace | match csn Jun 18 14:36:19.504064 Received L1 CSN, source R2, interface fe-1/2/0.0 Jun 18 14:36:19.523065 Received L2 CSN, source R2, interface fe-1/2/0.0 Jun 18 14:36:48.904120 Received L1 CSN, source R2, interface fe-1/2/0.0 Jun 18 14:36:48.916425 Received L2 CSN, source R2, interface fe-1/2/0.0 Jun 18 14:37:14.954447 Received L1 CSN, source R2, interface fe-1/2/0.0 Jun 18 14:37:14.971329 Received L2 CSN, source R2, interface fe-1/2/0.0 Jun 18 14:37:44.227106 Received L1 CSN, source R2, interface fe-1/2/0.0 Jun 18 14:37:44.244181 Received L2 CSN, source R2, interface fe-1/2/0.0
意义
输出显示大约每 30 秒接收一次 1 级和 2 级 CSNP。