TCP 身份验证选项 (TCP-AO)
总结 了解 BGP 和 LDP 会话的 TCP 身份验证选项 (TCP-AO)。
用于 BGP 和 LDP 会话的 TCP-AO
BGP 和 LDP 协议使用 TCP 进行传输。TCP-AO 是 RFC5925 提出的一种新的身份验证方法,TCP 身份验证选项旨在增强在 BGP 和 LDP 会话期间交换的 TCP 分段的安全性和真实性。它还支持 IPv4 和 IPv6 流量。
TCP-AO 的优势
与 TCP MD5 比,TCP-AO 提供以下优势:
-
更强大的算法 — 支持多个更强大的身份验证算法,如 HMAC-SHA-1-96 和 AES-128-CMAC-96(由 RFC5925,TCP 身份验证选项强制要求)。HMAC-SHA-1-96 是基于哈希的 MAC,而 AES-128-CMAC-96 是基于密码的 MAC,因此与使用 MD5 算法创建的摘要相比,消息摘要更加复杂和安全。
-
双折叠安全性 — 在 TCP-AO 方法中,配置了身份验证算法分两个阶段使用:一旦从用户配置的密钥生成内部流量密钥,然后使用生成的流量密钥生成消息摘要;而在 TCP MD5 方法中,MD5 算法会使用用户配置的密钥生成消息摘要。
-
更好的密钥管理和敏捷性 — 可以为一个会话配置多达 64 个密钥,并在会话的整个生命周期内随时添加这些密钥。它提供了一种简单的密钥协调机制,可在不会导致任何 TCP 连接关闭的情况下在同一连接内更改密钥(从一个密钥移动到另一个密钥)。在建立连接期间更改 TCP MD5 密钥可能会导致连接翻动或重新启动。
-
适用于长期连接 — 更适合 BGP 和 LDP 等路由协议以及跨单个连接的重复实例的长寿命连接。
什么是 TCP-AO?
TCP-AO 提供了一个框架:
-
支持多个更强大的算法,如 HMAC-SHA1 和 AES-128,以创建内部流量密钥和消息摘要。
-
添加新用户配置的密钥,为已建立的连接重新生成内部流量密钥,以及同步 BGP 或 LDP 对等方之间的密钥更改的机制。
在早期版本中,Junos 设备仅支持用于 BGP 和 LDP 会话的 TCP MD5 身份验证方法。MD5 方法仅支持 MD5 算法,其安全性不如 TCP-AO。此外,与 TCP-AO 不同,更改 MD5 密钥通常会中断 TCP 会话。TCP MD5 在 RFC2385 中定义,通过 TCP MD5 签名选项保护 BGP 会话。有关 TCP MD5 的详细信息,请参阅 TCP。
-
虽然 Junos 设备同时支持 TCP-AO 和 TCP MD5 身份验证方法,但对于给定连接,您不能同时同时使用这两种方法。
-
TCP-AO 支持 不间断主动路由。
下图解释了 TCP-AO 和 TCP MD5 身份验证之间的区别。第一个流显示 TCP-AO 的配置和处理流,第二个流显示 TCP-MD5 的配置和处理流。
以下是图 1 所示的处理流说明:
-
TCP-AO — 用户使用所有必要的参数在密钥链中配置了两个密钥(密钥 0 和密钥 1)。密钥链支持两种算法:HMAC SHA1 和 AES-128(根据 RFC5925 强制要求)。TCP 提取密钥 0,即当前处于活动状态的密钥,如图中的时间戳所示。在本示例中,密钥 0 配置了 HMAC-SHA1。
SHA1 采用“密钥 0 配置”和连接特定参数进行加密,并生成内部流量密钥。
SHA1 再次加密内部流量密钥和 TCP 分段,以生成消息摘要。摘要将复制到 TCP 分段中 TCP-AO 选项的 TCP-AO MAC 字段。然后,该分段被发送至接收设备。
-
TCP-MD5 — 用户配置了一个密钥,因为 TCP MD5 选项仅支持一个连接密钥。此外,它仅支持 MD5 算法。MD5 算法从密钥和 TCP 分段中获取“密钥”进行加密,并生成消息摘要。然后,此消息摘要复制到 TCP 分段中的 MD5 摘要字段,并发送至接收设备。
配置
首先,配置钥匙串。然后将 TCP-AO 应用于 BGP 或 LDP 会话。
要为 TCP-AO 配置密钥链(使用一个密钥),请在 [edit security]
层次结构级别配置以下语句。
[edit security] user@router# set authentication-key-chains key-chain key-chain key id secret secretpassword start-time YYYY-MM-DD.HH:MM algorithm ao ao-attribute send-id send-id recv-id recv-id cryptographic-algorithm cryptographic-algorithm tcp-ao-option enabled
要向 BGP 会话应用 TCP-AO(使用配置的密钥链),请在 [edit protocols]
层次结构级别配置以下语句。
[edit protocols] user@router# set bgp group group neighbor neighbor authentication-algorithm ao user@router# set bgp group group neighbor neighbor authentication-key-chain key-chain
要向 LDP 会话应用 TCP-AO(使用配置的密钥链),请在 [edit protocols]
层次结构级别配置以下语句。
[edit protocols] user@router# set ldp session session authentication-algorithm ao user@router# set ldp session session authentication-key-chain key-chain
示例:配置密钥链 (TCP-AO)
总结 此示例说明如何创建 TCP-AO 密钥链来验证 BGP 或 LDP 会话。
此示例使用以下硬件和软件组件:
MX 系列或 PTX 系列路由器。
Junos OS 20.3R1 或更高版本。
此示例说明如何创建 TCP-AO 密钥链来验证 BGP 或 LDP 会话。
在此示例中,您可以在设备 R1 和 R2 上创建一个包含两个密钥的密钥 key 0
key 1
链new_auth_key
。
您已成功创建密钥链!
要删除密钥链,请 delete security authentication-key-chains key-chain key-chain-name
从配置模式使用命令。
-
在生命周期内,您只能将一个 TCP-AO 密钥链与 BGP 或 LDP 会话关联。您不能在会话生命周期内将另一个密钥链指向该会话。
-
我们建议,在一个密钥链中,任意两个后续密钥的开始时间之间的最小间隔为 30 分钟。
-
配置密钥链并由 TCP 连接使用后,便无法更改
send-id
其活动密钥的或recv-id
值。但是,您可以更改密钥中的其他参数,与更新的密钥链关联的任何新连接都将采用更新后的参数进行连接建立。 -
从 Junos OS 21.2R1 版开始,如果任何一个 TCP 端点上没有配置 TCP-AO,您可以使用
tcpao-auth-mismatch allow-without-tcpao
它来允许在没有 TCP-AO 的情况下建立连接。
要从操作模式显示有关现有密钥链(如果有)的信息,请使用 show security keychain
命令。下面是示例输出:
user@R1> show security keychain
Keychain Active-ID Next-ID Transition Tolerance Send Receive Send Receive new_auth_key 1 1 None None None 3600 (secs)
示例:使用 TCP-AO 对 BGP 会话进行身份验证
总结 此示例说明如何使用 TCP 身份验证选项 (TCP-AO) 密钥链来验证 BGP 会话。
要求
此示例使用以下硬件和软件组件:
-
MX 系列或 PTX 系列路由器。
-
Junos OS 20.3R1 或更高版本。
-
配置密钥链
new_auth_key
。请参阅配置密钥链 (TCP-AO)。
概述
BGP 使用 TCP 作为其传输协议。TCP-AO 是一种可用于验证 BGP 会话的方法。您可以在 BGP 邻接方或配置层次结构的 BGP 组级别应用 TCP-AO 密钥链。
拓扑
配置
在此示例中,您将关联两台设备上的 TCP-AO 身份验证密钥链 new_auth_key
和身份验证算法 ao
,以便对 BGP 会话进行身份验证。
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到 CLI 中。
R1
[edit] set interfaces ge-0/0/1 description R1-to-R2-Link set interfaces ge-0/0/1 unit 0 family inet address 192.0.2.1/30 set interfaces lo0 unit 0 family inet address 192.168.0.11/32 set routing-options router-id 192.168.0.11 set routing-options autonomous-system 65500 set protocols bgp group ebgp_grp type external set protocols bgp group ebgp_grp peer-as 65501 set protocols bgp group ebgp_grp neighbor 192.0.2.2 set protocols bgp group ebgp_grp neighbor 192.0.2.2 authentication-key-chain new_auth_key set protocols bgp group ebgp_grp neighbor 192.0.2.2 authentication-algorithm ao
R 2
[edit] set interfaces ge-0/0/1 description R2-to-R1-Link set interfaces ge-0/0/1 unit 0 family inet address 192.0.2.2/30 set interfaces lo0 unit 0 family inet address 192.168.0.12/32 set routing-options router-id 192.168.0.12 set routing-options autonomous-system 65501 set protocols bgp group ebgp_grp type external set protocols bgp group ebgp_grp peer-as 65500 set protocols bgp group ebgp_grp neighbor 192.0.2.1 set protocols bgp group ebgp_grp neighbor 192.0.2.1 authentication-key-chain new_auth_key set protocols bgp group ebgp_grp neighbor 192.0.2.1 authentication-algorithm ao
逐步过程
-
进入配置模式。
-
配置基本设置,如两台设备上的接口 IP 地址、接口说明、环路地址、路由器 ID 和 AS 编号。
R1
[edit]
user@R1# set interfaces ge-0/0/1 description R1-to-R2-Link user@R1# set interfaces ge-0/0/1 unit 0 family inet address 192.0.2.1/30 user@R1# set interfaces lo0 unit 0 family inet address 192.168.0.11/32 user@R1# set routing-options router-id 192.168.0.11 user@R1# set routing-options autonomous-system 65500R 2
[edit]
user@R2# set interfaces ge-0/0/1 description R2-to-R1-Link user@R2# set interfaces ge-0/0/1 unit 0 family inet address 192.0.2.2/30 user@R2# set interfaces lo0 unit 0 family inet address 192.168.0.12/32 user@R2# set routing-options router-id 192.168.0.12 user@R2# set routing-options autonomous-system 65501 -
在 R1 和 R2 之间配置 EBGP。
R1
[edit]
user@R1# set protocols bgp group ebgp_grp type external user@R1# set protocols bgp group ebgp_grp peer-as 65501 user@R1# set protocols bgp group ebgp_grp neighbor 192.0.2.2R 2
[edit]
user@R2# set protocols bgp group ebgp_grp type external user@R2# set protocols bgp group ebgp_grp peer-as 65500 user@R2# set protocols bgp group ebgp_grp neighbor 192.0.2.1 -
将认证密钥链
new_auth_key
和身份验证算法ao
与两台设备上的 BGP 会话相关联。R1
[edit]
user@R1# set protocols bgp group ebgp_grp neighbor 192.0.2.2 authentication-key-chain new_auth_key user@R1# set protocols bgp group ebgp_grp neighbor 192.0.2.2 authentication-algorithm aoR 2
[edit]
user@R2# set protocols bgp group ebgp_grp neighbor 192.0.2.1 authentication-key-chain new_auth_key user@R2# set protocols bgp group ebgp_grp neighbor 192.0.2.1 authentication-algorithm ao -
在两台设备上从配置模式进入
commit
。在两台设备上提交配置语句后,BGP 会话应使用 TCP-AO 身份验证方法建立。
结果
使用 show interfaces
、 show routing-options
和 show protocols
配置模式下的命令确认您的配置。
user@R1# show interfaces
ge-0/0/1 { description R1-to-R2-Link; unit 0 { family inet { address 192.0.2.1/30; } } } lo0 { unit 0 { family inet { address 192.168.0.11/32; } } }
user@R1# show routing-options
autonomous-system 65500;
user@R1# show protocols
bgp { group ebgp_grp { type external; peer-as 65500; neighbor 192.0.2.1 { authentication-algorithm ao; authentication-key-chain new_auth_key; { { {
bgp { group ebgp_grp { type external; peer-as 65551; neighbor 192.0.2.2 { authentication-algorithm ao; authentication-key-chain new_auth_key; } } }
验证
验证 BGP 会话建立
目的
启用 TCP-AO 后,确认 BGP 会话建立输出。
行动
使用操作模式命令查看 BGP 会话状态的 show bgp summary
BGP 摘要。
user@R1> show bgp summary Threading mode: BGP I/O Default eBGP mode: advertise - accept, receive - accept Groups: 1 Peers: 1 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 0 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 192.0.2.2 65501 6 4 0 0 1:19 Establ inet.0: 0/0/0/0
意义
突出显示的输出值表示 BGP 已成功地在 1:19 分钟前使用 TCP-AO 身份验证方法建立了会话。
验证 BGP 会话是否正在使用 TCP-AO
目的
验证 BGP 邻接方是否使用 TCP-AO 密钥链进行验证。
行动
show bgp neighbor neighbor
使用命令查看 BGP 对等方的配置详细信息。要仅过滤输出中特定于身份验证的详细信息,请使用管道 (|) 功能并在上authentication
匹配,如下所示:
user@R1> show bgp neighbor 192.0.2.2 | match authentication Authentication key chain: new_auth_key Authentication algorithm: ao
意义
输出指示将认证密钥链 new_auth_key
和身份验证算法 ao
应用于 BGP 邻接方 192.0.2.2
。
示例:使用 TCP-AO 对 LDP 会话进行身份验证
总结 此示例说明如何使用 TCP 身份验证选项 (TCP-AO) 密钥链对 LDP 会话进行身份验证。
要求
此示例使用以下硬件和软件组件:
-
MX 系列或 PTX 系列路由器。
-
Junos OS 20.3R1 或更高版本。
-
配置密钥链
new_auth_key
。请参阅配置密钥链 (TCP-AO)。
概述
标签分配协议 (LDP) 是一种 MPLS 信令协议。它允许路由器通过网络建立标签交换路径 (LSP)。TCP-AO 有助于增强在 LDP 对等方之间创建的会话的安全性。
配置
在此示例中,您将 TCP-AO 身份验证密钥链 new_auth_key
和身份验证算法 ao
关联到两台设备,以验证其 LDP 会话。
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到 CLI 中。
R1
[edit]
set interfaces ge-0/0/1 description R1-to-R2-Link
set interfaces ge-0/0/1 unit 0 family inet address 192.0.2.1/30
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.168.0.11/32
set routing-options router-id 192.168.0.11
set protocols ldp interface ge-0/0/1.0
set protocols ldp interface lo0.0
set protocols ldp session 192.168.0.12 authentication-algorithm ao
set protocols ldp session 192.168.0.12 authentication-key-chain new_auth_key
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ospf area 0.0.0.0 interface lo0.0
R 2
[edit]
set interfaces ge-0/0/1 description R2-to-R1-Link
set interfaces ge-0/0/1 unit 0 family inet address 192.0.2.2/30
set interfaces ge-0/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 192.168.0.12/32
set routing-options router-id 192.168.0.12
set protocols ldp interface ge-0/0/1.0
set protocols ldp interface lo0.0
set protocols ldp session 192.168.0.11 authentication-algorithm ao
set protocols ldp session 192.168.0.11 authentication-key-chain new_auth_key
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ospf area 0.0.0.0 interface lo0.0
逐步过程
-
进入配置模式。
-
配置基本设置,例如设备接口、环路、接口说明、路由器 ID 和 R2 上的 AS 编号。
R1
[edit]
user@R1# set interfaces ge-0/0/1 description R1-to-R2-Link user@R1# set interfaces ge-0/0/1 unit 0 family inet address 192.0.2.1/30 user@R1# set interfaces lo0 unit 0 family inet address 192.168.0.11/32 user@R1# set routing-options router-id 192.168.0.11R 2
[edit]
user@R2# set interfaces ge-0/0/1 description R2-to-R1-Link user@R2# set interfaces ge-0/0/1 unit 0 family inet address 192.0.2.2/30 user@R2# set interfaces lo0 unit 0 family inet address 192.168.0.12/32 user@R2# set routing-options router-id 192.168.0.12 -
在两台设备上配置 MPLS 和 LDP。
R1
[edit]
user@R1# set interfaces ge-0/0/1 unit 0 family mpls user@R1# set protocols ldp interface ge-0/0/1.0 user@R1# set protocols ldp interface lo0.0R 2
[edit]
user@R2# set interfaces ge-0/0/1 unit 0 family mpls user@R2# set protocols ldp interface ge-0/0/1.0 user@R2# set protocols ldp interface lo0.0 -
配置内部网关协议 (IGP),以通告环路地址可访问性。在此示例中,我们配置 OSPF。
R1
[edit protocols]
user@R1# set ospf area 0.0.0.0 interface ge-0/0/1.0 user@R1# set ospf area 0.0.0.0 interface lo0.0 passiveR 2
[edit protocols]
user@R2# set ospf area 0.0.0.0 interface ge-0/0/1.0 user@R2# set ospf area 0.0.0.0 interface lo0.0 passive -
与 R1 和
authentication-algorithm ao
R2 的标签空间 ID 关联authentication-key-chain new_auth_key
。R1
[edit protocols]
user@R1# set ldp session 192.168.0.12 authentication-algorithm ao user@R1# set ldp session 192.168.0.12 authentication-key-chain new_auth_keyR 2
[edit protocols]
user@R2# set ldp session 192.168.0.11 authentication-algorithm ao user@R2# set ldp session 192.168.0.11 authentication-key-chain new_auth_key -
从两台设备的配置模式进入
commit
。
结果
使用和 show routing-options
show protocols
命令确认show interfaces
您的配置。
user@R1# show interfaces
ge-0/0/1 { description R1-to-R2-Link; unit 0 { family inet { address 192.0.2.1/30; } } } lo0 { unit 0 { family inet { address 192.168.0.11/32; } } }
user@R1# show routing-options
router-id 192.168.0.11;
user@R1# show protocols
ldp { interface ge-0/0/1.0; interface lo0.0 passive; authentication-algorithm ao; authentication-key-chain new_auth_key; { { ospf { area 0.0.0.0 { interface ge-0/0/1.0; interface lo0.0; { {
验证
验证 LDP 会话
目的
使用 TCP-AO 验证 LDP 会话建立。
行动
使用 show ldp session detail
操作模式命令验证是否已正确建立 LDP 会话。
user@R1> show ldp session detail Address: 192.168.0.12, State: Operational, Connection: Open, Hold time: 22 Session ID: 192.168.0.11:0--192.168.0.12:0 Next keepalive in 2 seconds Passive, Maximum PDU: 4096, Hold time: 30, Neighbor count: 1 Neighbor types: discovered Keepalive interval: 10, Connect retry interval: 1 Local address: 192.168.0.11, Remote address: 192.168.0.12 Up for 01:11:59 Last down 01:13:12 ago; Reason: authentication key was changed Number of session flaps: 2 Capabilities advertised: none Capabilities received: none Protection: disabled Session flags: none Authentication type: new_auth_key(ao key-chain, 192.168.0.12/32) Local - Restart: disabled, Helper mode: enabled Remote - Restart: disabled, Helper mode: enabled Local maximum neighbor reconnect time: 120000 msec Local maximum neighbor recovery time: 240000 msec Local Label Advertisement mode: Downstream unsolicited Remote Label Advertisement mode: Downstream unsolicited Negotiated Label Advertisement mode: Downstream unsolicited MTU discovery: disabled Nonstop routing state: Not in sync Next-hop addresses received: 192.0.2.2 192.168.0.12 128.49.110.110
意义
输出指示已建立 LDP 会话。
示例:使用 TCP-AO 对 RPKI 验证会话进行身份验证
概述
资源公钥基础架构 (RPKI) 是一个公钥基础架构框架,旨在保护互联网的路由基础架构,特别是 BGP。RPKI 提供了一种将互联网编号资源信息(如 IP 地址)连接到信任锚点的方法。通过使用 RPKI,编号资源的合法持有者能够控制互联网路由协议的操作,以防止路由劫持和其他攻击。
从 Junos OS 22.2R1 版开始,您可以使用 TCP 身份验证选项 (TCP-AO) 和密钥链来验证 RPKI 会话。
此示例说明如何使用 TCP-AO 密钥链验证 RPKI 验证会话。我们将在客户端设备 (R1) 和服务器 (R2) 之间建立经过身份验证的 RPKI 会话。
要求
此示例使用以下硬件和软件组件:
- 2 台 MX 系列路由器
- Junos OS 22.2R1 或更高版本。
拓扑
配置
在此示例中,您必须将两台设备上的 TCP-AO 身份验证密钥链 new_auth_key
和身份验证算法 ao
相关联,以便对 RPKI 连接进行身份验证。
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到 CLI 中。
R1
[edit] set system host-name R1 set interfaces ge-0/0/0 description R1-to-R2-Link set interfaces ge-0/0/0 unit 0 family inet address 192.168.12.1/24 set interfaces lo0 unit 0 family inet address 172.16.255.1/32 set routing-options router-id 172.16.255.1 set routing-options autonomous-system 65500 set security authentication-key-chains key-chain new_auth_key key 0 secret "$ABC123" set security authentication-key-chains key-chain new_auth_key key 0 start-time "2022-5-18.04:00:00 -0700" set security authentication-key-chains key-chain new_auth_key key 0 algorithm ao set security authentication-key-chains key-chain new_auth_key key 0 ao-attribute send-id 3 set security authentication-key-chains key-chain new_auth_key key 0 ao-attribute recv-id 8 set security authentication-key-chains key-chain new_auth_key key 1 secret "$ABC123" set security authentication-key-chains key-chain new_auth_key key 1 start-time "2022-6-18.04:00:00 -0700" set security authentication-key-chains key-chain new_auth_key key 1 algorithm ao set security authentication-key-chains key-chain new_auth_key key 1 ao-attribute send-id 1 set security authentication-key-chains key-chain new_auth_key key 1 ao-attribute recv-id 2 set routing-options validation group to_servers session 192.168.12.2 port 8282 set routing-options validation group to_servers session 192.168.12.2 authentication-algorithm ao set routing-options validation group to_servers session 192.168.12.2 authentication-key-chain new_auth_key
R 2
[edit] set system host-name R2 set logical-systems rv_server_1 interfaces ge-0/0/0 unit 0 family inet address 192.168.12.2/24 set interfaces lo0 unit 0 family inet address 172.16.255.2/32 set routing-options router-id 172.16.255.2 set routing-options autonomous-system 65501 set logical-systems rv_server_1 routing-options validation local-cache listen-port 8282 set logical-systems rv_server_1 routing-options validation group to_dut session 192.168.12.1 local-cache set logical-systems rv_server_1 routing-options validation group to_dut session 192.168.12.1 local-address 192.168.12.2 set security authentication-key-chains key-chain new_auth_key key 0 secret "$ABC123" set security authentication-key-chains key-chain new_auth_key key 0 start-time "2022-5-18.04:00:00 -0700" set security authentication-key-chains key-chain new_auth_key key 0 algorithm ao set security authentication-key-chains key-chain new_auth_key key 0 ao-attribute send-id 8 set security authentication-key-chains key-chain new_auth_key key 0 ao-attribute recv-id 3 set security authentication-key-chains key-chain new_auth_key key 1 secret "$ABC123" set security authentication-key-chains key-chain new_auth_key key 1 start-time "2022-6-18.04:00:00 -0700" set security authentication-key-chains key-chain new_auth_key key 1 algorithm ao set security authentication-key-chains key-chain new_auth_key key 1 ao-attribute send-id 2 set security authentication-key-chains key-chain new_auth_key key 1 ao-attribute recv-id 1 set logical-systems rv_server_1 routing-options validation group to_dut session 192.168.12.1 authentication-algorithm ao set logical-systems rv_server_1 routing-options validation group to_dut session 192.168.12.1 authentication-key-chain new_auth_key
逐步过程
-
在两台设备上配置基本设置,如接口、环路地址、路由器 ID 和 AS 编号。在 R2 上,我们为服务器配置逻辑系统接口。
R1
[edit] user@R1# set system host-name R1 user@R1# set interfaces ge-0/0/0 description R1-to-R2-Link user@R1# set interfaces ge-0/0/0 unit 0 family inet address 192.168.12.1/24 user@R1# set interfaces lo0 unit 0 family inet address 172.16.255.1/32 user@R1# set routing-options router-id 172.16.255.1 user@R1# set routing-options autonomous-system 65500
R 2
[edit] user@R2# set system host-name R2 user@R2# set logical-systems rv_server_1 interfaces ge-0/0/0 unit 0 family inet address 192.168.12.2/24 user@R2# set interfaces lo0 unit 0 family inet address 172.16.255.2/32 user@R2# set routing-options router-id 172.16.255.2 user@R2# set routing-options autonomous-system 65501
-
使用备用 TCP 端口号在客户端设备 (R1) 上使用 RPKI 服务器 (R2) 配置 TCP 会话。
R1
[edit] user@R1# set routing-options validation group to_servers session 192.168.12.2 port 8282
-
在服务器 R2 上,配置 RPKI 会话与客户端 R1 进行源验证。
[edit] user@R2# set logical-systems rv_server_1 routing-options validation group to_dut session 192.168.12.1 local-cache user@R2# set logical-systems rv_server_1 routing-options validation group to_dut session 192.168.12.1 local-address 192.168.12.2
-
使用第一个密钥(密钥 0)创建密钥链
new_auth_key
:R1
[edit security] user@R1# set authentication-key-chains key-chain new_auth_key key 0 secret secretpassword start-time 2022-5-18.04:00 algorithm ao ao-attribute send-id 3 recv-id 8
R2 (发送 id 和 recv-id 值反转)
[edit security] user@R2# set authentication-key-chains key-chain new_auth_key key 0 secret secretpassword start-time 2022-5-18.04:00 algorithm ao ao-attribute send-id 8 recv-id 3
-
要添加另一个密钥(密钥 1),在创建密钥 0 后:
R1
[edit security authentication-key-chains key-chain new_auth_key] user@R1# set key 1 secret secretpassword start-time 2022-6-18.04:00 algorithm ao ao-attribute send-id 1 recv-id 2
R2 (发送 id 和 recv-id 值反转)
[edit security authentication-key-chains key-chain new_auth_key] user@R2# set key 1 secret secretpassword start-time 2022-6-18.04:00 algorithm ao ao-attribute send-id 2 recv-id 1
-
在 R1 和 R2 上应用配置的密钥链
new_auth_key
和身份验证算法ao
。R1
[edit] user@R1# set routing-options validation group to_servers session 192.168.12.2 authentication-algorithm ao user@R1# set routing-options validation group to_servers session 192.168.12.2 authentication-key-chain new_auth_key
R 2
[edit] user@R2# set logical-systems rv_server_1 routing-options validation group to_dut session 192.168.12.1 authentication-algorithm ao user@R2# set logical-systems rv_server_1 routing-options validation group to_dut session 192.168.12.1 authentication-key-chain new_auth_key
-
在两台设备上从配置模式进入
commit
,以激活更改。 -
要验证配置了两个密钥的密钥链
new_auth_key
,请在show security authentication-key-chains
配置模式下使用命令。
结果
检查 R1 上的密钥链配置结果:
user@R1# show security authentication-key-chains
key-chain new_auth_key { key 0 { secret "$ABC123"; ## SECRET-DATA start-time "2022-5-18.04:00:00 -0700"; algorithm ao; ao-attribute { send-id 3; recv-id 8; } } key 1 { secret "$ABC123"; ## SECRET-DATA start-time "2022-6-18.04:00:00 -0700"; algorithm ao; ao-attribute { send-id 1; recv-id 2; } } }
使用以下命令确认在 R1 上应用的剩余配置:
user@R1# show interfaces
ge-0/0/0 { description R1-to-R2-Link; unit 0 { family inet { address 192.168.12.1/24; } } } lo0 { unit 0 { family inet { address 172.16.255.1/32; } } }
user@R1# show routing-options
router-id 172.16.255.1; autonomous-system 65500; validation { group to_servers { session 192.168.12.2 { authentication-algorithm ao; authentication-key-chain new_auth_key; port 8282; } } }
验证
目的
验证是否使用两个对等方上配置的 TCP-AO 密钥链和算法建立会话。
行动
使用 show validation session 192.168.12.2 detail
操作模式命令查看经过验证的会话。
user@R1> show validation session 192.168.12.2 detail Session 192.168.12.2, State: up, Session index: 2 Group: to_servers, Preference: 100 Port: 8282 Refresh time: 300s Hold time: 600s Record Life time: 3600s Serial (Full Update): 6 Serial (Incremental Update): 6 Authentication key-chain: new_auth_key Session flaps: 1 Session uptime: 2d 01:40:05 Last PDU received: 00:04:59 IPv4 prefix count: 0 IPv6 prefix count: 0
意义
输出指示已配置的密钥链 new_auth_key
启动会话。