示例:为 IS-IS 配置无中断认证密钥滚动
此示例说明如何为 IS-IS 配置无中断认证密钥滚动更新。
要求
在为 IS-IS 配置无间断认证密钥滚动之前,不需要除设备初始化之外的特殊配置。
概述
身份验证可确保只有可信的路由器参与路由更新。此密钥串身份验证方法称为无中断,因为密钥从一个密钥滚动到另一个密钥,而不会重置任何对等会话或中断路由协议。Junos OS 支持 RFC 5304 IS-IS 加密身份验证 和 RFC 5310 IS-IS 通用加密身份验证。
此示例包含以下用于配置钥匙串的语句:
-
算法 - 对于钥匙串中的每个密钥,您可以指定加密算法。该算法可以是 SHA-1 或 MD-5。
-
key - 钥匙串可以有多个密钥。钥匙串中的每个键都必须由唯一的整数值标识。有效标识符值的范围为 0 到 63。
-
钥匙串 - 对于每个钥匙串,您必须指定一个名称。此示例定义了两个密钥链: base-key-global 和 base-key-inter。
-
options - 对于钥匙串中的每个键,您可以指定消息身份验证代码的编码:isis-enhanced 或 basic。默认情况下,基本 (RFC 5304)作处于启用状态。
配置 isis-enhanced 选项时,Junos OS 会发送 RFC 5310 编码的路由协议数据包,并接受从其他设备接收的 RFC 5304 和 RFC 5310 编码的路由协议数据包。
配置 基本 配置(或在密钥配置中不包含 options 语句)时,Junos OS 会发送和接收 RFC 5304 编码的路由协议数据包,并丢弃从其他设备接收的 5310 编码的路由协议数据包。
由于此设置仅适用于 IS-IS,因此 TCP 和 BFD 协议将忽略密钥中配置的编码选项。
-
secret - 对于钥匙串中的每个密钥,您必须设置一个密钥密码。此密码可以在 密钥 语句中以加密或纯文本格式输入。它始终以加密格式显示。
-
start-time - 每个键必须使用 ISO 8601 格式根据 UTC 指定开始时间。控制权从一个键传递到下一个键。当配置的开始时间到达时(基于路由设备的时钟),包含该开始时间的密钥将变为活动状态。开始时间以当地时区为路由设备指定,并且在密钥链中必须是唯一的。
您可以将钥匙串全局应用于所有接口,也可以更精细地应用于特定接口。
此示例包含以下语句,用于将密钥串应用于所有接口或特定接口:
-
authentication-key-chain — 允许您在全局 IS-IS 级别为所有 1 级或所有 2 级接口应用密钥链。
-
hello-authentication-key-chain — 允许您在各个 IS-IS 接口级别应用密钥串。接口配置将覆盖全局配置。
配置
程序
用于 R0 的 CLI 快速配置
要为 IS-IS 快速配置无中断认证密钥滚动,请复制以下命令并将命令粘贴到 CLI 中。
[edit] set interfaces ge-0/0/0 unit 0 description "interface A" set interfaces ge-0/0/0 unit 0 family inet address 10.0.0.1/30 set interfaces ge-0/0/0 unit 0 family iso set interfaces ge-0/0/0 unit 0 family inet6 address fe80::200:f8ff:fe21:67cf/128 set interfaces ge-0/0/1 unit 0 description "interface B" set interfaces ge-0/0/1 unit 0 family inet address 10.0.0.5/30 set interfaces ge-0/0/1 unit 0 family iso set interfaces ge-0/0/1 unit 0 family inet6 address 10FB::C:ABC:1F0C:44DA/128 set interfaces ge-0/0/2 unit 0 description "interface C" set interfaces ge-0/0/2 unit 0 family inet address 10.0.0.9/30 set interfaces ge-0/0/2 unit 0 family iso set interfaces ge-0/0/2 unit 0 family inet6 address ff06::c3/128 set security authentication-key-chains key-chain base-key-global key 63 secret "$ABC123" set security authentication-key-chains key-chain base-key-global key 63 start-time "2011-8-6.06:54:00-0700" set security authentication-key-chains key-chain base-key-global key 63 algorithm hmac-sha-1 set security authentication-key-chains key-chain base-key-global key 63 options isis-enhanced set security authentication-key-chains key-chain base-key-global key 64 secret "$ABC1234" set security authentication-key-chains key-chain base-key-global key 64 start-time "2011-10-6.06:54:00-0700" set security authentication-key-chains key-chain base-key-global key 64 algorithm hmac-sha-1 set security authentication-key-chains key-chain base-key-global key 64 options isis-enhanced set security authentication-key-chains key-chain base-key-inter key 0 secret "$ABC123" set security authentication-key-chains key-chain base-key-inter key 0 start-time "2011-8-6.06:54:00-0700" set security authentication-key-chains key-chain base-key-inter key 0 algorithm md5 set security authentication-key-chains key-chain base-key-inter key 0 options basic set security authentication-key-chains key-chain base-key-inter key 1 secret "$ABC1234" set security authentication-key-chains key-chain base-key-inter key 1 start-time "2011-10-6.06:54:00-0700" set security authentication-key-chains key-chain base-key-inter key 1 algorithm md5 set security authentication-key-chains key-chain base-key-inter key 1 options basic set protocols isis level 2 authentication-key-chain base-key-global set protocols isis interface ge-0/0/0.0 level 1 hello-authentication-key-chain base-key-inter
分步过程
要为 IS-IS 配置无中断认证密钥滚动:
-
配置路由器 R0 接口。
[edit] user@host# edit interfaces ge-0/0/0 unit 0 [edit interfaces ge-0/0/0 unit 0] user@host# set description "interface A" user@host# set family inet address 10.0.0.1/30 user@host# set family iso user@host# set family inet6 address fe80::200:f8ff:fe21:67cf/128 user@host# exit [edit] user@host# edit interfaces ge-0/0/1 unit 0 [edit interfaces ge-0/0/1 unit 0] user@host# set interfaces ge-0/0/1 unit 0 description "interface B" user@host# set interfaces ge-0/0/1 unit 0 family inet address 10.0.0.5/30 user@host# set interfaces ge-0/0/1 unit 0 family iso user@host# set interfaces ge-0/0/1 unit 0 family inet6 address 10FB::C:ABC:1F0C:44DA/128 user@host# exit [edit] user@host# edit interfaces ge-0/0/2 unit 0 [edit interfaces ge-0/0/2 unit 0] user@host# set description "interface C" user@host# set family inet address 10.0.0.9/30 user@host# set interfaces ge-0/0/2 unit 0 family iso user@host# set interfaces ge-0/0/2 unit 0 family inet6 address ff06::c3/128 user@host# exit
-
配置一个或多个身份验证密钥链和密钥。在此示例中,我们演示了全局密钥链和接口级密钥链的使用,两者都有两个密钥。全局密钥链适用于所有 ISIS 2 级接口。此密钥链可对 hellos 和 LSP 交换进行身份验证。接口密钥链专门应用于 ISIS 级别 1 的 ge-0/0/0 接口(接口 A),并且仅用于验证hello 交换。
[edit] user@host# edit security authentication-key-chains key-chain base-key-global [edit security authentication-key-chains key-chain base-key-global] user@host# set key 63 secret "$ABC123" user@host# set key 63 start-time "2011-8-6.06:54:00-0700" user@host# set key 63 algorithm hmac-sha-1 user@host# set key 63 options isis-enhanced user@host# set key 64 secret "$ABC1234" user@host# set key 64 start-time "2011-10-6.06:54:00-0700" user@host# set key 64 algorithm hmac-sha-1 user@host# set key 64 options isis-enhanced user@host# exit [edit] user@host# edit security authentication-key-chains key-chain base-key-inter [edit security authentication-key-chains key-chain base-key-inter] user@host# set key 0 secret "$ABC123" user@host# set key 0 start-time "2011-8-6.06:54:00-0700" user@host# set key 0 algorithm md5 user@host# set key 0 options basic user@host# set key 1 secret "$ABC1234" user@host# set key 1 start-time "2011-10-6.06:54:00-0700" user@host# set key 1 algorithm md5 user@host# set key 1 options basic user@host# exit
-
将 base-key-global 密钥链应用于路由器 R0 上的所有 2 级 ISIS 接口。
[edit] user@host# edit protocols isis level 2 [edit protocols isis level 1] set authentication-key-chain base-key-global user@host# exit
-
将用于级别 1 的 ISIS hello 身份验证的 base-key-inter 密钥链应用于路由器 R0 上的 ge-0/0/0.0 接口。
[edit] user@host# edit protocols isis interface ge-0/0/0.0 level 1 [edit protocols isis interface ge-0/0/0.0 level 1] set hello-authentication-key-chain base-key-inter user@host# exit
-
如果完成设备配置,请提交配置。
[edit] user@host# commit
结果
输入 show interfaces、 show protocols 和 show security 命令,以确认您的配置。
user@host# show interfaces
ge-0/0/0 {
unit 0 {
description "interface A";
family inet {
address 10.0.0.1/30;
}
family iso;
family inet6 {
address fe80::200:f8ff:fe21:67cf/128;
}
}
}
ge-0/0/1 {
unit 0 {
description "interface B";
family inet {
address 10.0.0.5/30;
}
family iso;
family inet6 {
address 10FB::C:ABC:1F0C:44DA/128;
}
}
}
ge-0/0/2 {
unit 0 {
description "interface C";
family inet {
address 10.0.0.9/30;
}
family iso;
family inet6 {
address ff06::c3/128;
}
}
}
user@host# show protocols
isis {
level 2 authentication-key-chain base-key-global;
interface ge-0/0/0.0 {
level 1 hello-authentication-key-chain base-key-inter;
}
}
user@host# show security
authentication-key-chains {
key-chain base-key-global {
key 63 {
secret "ABC123”;
start-time "2011-8-6.06:54:00-0700";
algorithm hmac-sha-1;
options isis-enhanced;
}
key 64 {
secret "ABC1234”;
start-time "2011-10-6.06:54:00-0700";
algorithm hmac-sha-1;
options isis-enhanced;
}
key-chain base-key-inter {
key 0 {
secret "$ABC123”;
start-time "2011-8-6.06:54:00-0700";
algorithm md5;
options basic;
}
key 1 {
secret "$ABC1234”;
start-time "2011-10-6.06:54:00-0700";
algorithm md5;
options basic;
}
}
}
验证
要验证配置,请运行以下命令:
-
显示 ISIS 身份验证
-
显示安全钥匙串
