示例:通过 MX 系列路由器上的 MPLS CCC 配置 MACsec
此示例说明如何启用 MACsec,以保护敏感流量通过基本 MPLS CCC 从一个站点的用户传输到另一站点的用户。
要求
此示例使用以下硬件和软件组件:
在 MPLS 网络中用作 PE 和提供商路由器的三个 MX 系列路由器
一个 MX 系列路由器用作将站点 A 连接到 MPLS 网络的 CE 路由器
一个 MX240、MX480 或 MX960 路由器,带有增强型 20 端口千兆以太网 MIC(型号 MIC-3D-20GE-SFP-E),用作将站点 B 连接到 MPLS 网络的 CE 路由器
在 MPLS 网络中的所有 MX 系列路由器(PE1、PE2 或提供商路由器)上运行的 Junos OS 15.1R1 或更高版本
在站点 A 的 CE 路由器和站点 B 的 CE 路由器上运行的 Junos OS 15.1R1 或更高版本
概述和拓扑
在此示例中,对财务敏感的公司数据经常在站点 A 的用户和站点 B 的用户之间发送。该公司希望确保从站点 A 的用户到 B 站点用户的所有网络流量都是高度安全的,攻击者无法查看或破坏。该公司正在使用 MACsec 提供的行业标准第 2 层安全解决方案,通过加密来确保攻击者无法查看数据,并执行完整性检查,以确保传输的数据不会损坏,从而保护通过连接站点的 MPLS 云在 CCC 上传输的所有流量。这两个站点均配置 VLAN,以确保在两个用户之间传输的流量通过 MACsec 安全 CCC 遍历这些站点。
此示例中的 MPLS 网络包括两个提供商边缘 (PE) 路由器(PE1 和 PE2)和一个提供商(传输)路由器。PE1 将站点 A 上的客户边缘 (CE) 路由器连接到 MPLS 网络,PE2 将站点 B 上的 CE 路由器连接到 MPLS 网络。在连接站点 A 和站点 B 的 CE 路由器的 CCC 上启用 MACsec,以保护通过 CCC 在站点之间传输的流量。VLAN,包括将用户连接到 CE 路由器的接口、站点 A CE 路由器上的接口 ge-0/0/0/0 和站点 B 的 CE 路由器上的接口 ge-0/0/2,以及将 CE 路由器连接到 MPLS 云的接口(站点 A CE 路由器上的 ge-0/0/0 和 B 站点 CE 路由器上的 xe-0/1/0) 用于将用户之间的所有流量定向到 MACsec 安全 CCC 上。
表 1 提供了此拓扑中 MPLS 网络组件的摘要。
表 2 汇总了此拓扑中使用的 MACsec 连接关联。MACsec 通过在链路两端的接口上创建连接关联来实现。当链路交换两端的接口以预共享密钥(预共享密钥在连接关联中定义)时,将启用 MACsec,以保护 MACsec 的链路。
表 3 汇总了此拓扑中使用的桥接域和 VLAN ID。此拓扑中使用的 VLAN 将所有通信从站点 A 的用户定向到站点 B 上的用户,并连接到 MACsec 安全 CCC。
组件 | 说明 |
---|---|
PE1 |
PE 路由器。 lo0:
ge-0/0/0:
ge-0/0/1:
|
供应商 |
提供商路由器。 lo0:
ge-0/0/10:
xe-0/0/0:
|
PE2 |
PE 路由器。 lo0:
xe-0/1/0
xe-0/1/1
|
lsp_to_pe2_xe1标签交换路径 |
从 PE1 到 PE2 的标签交换路径。 |
lsp_to_pe1_ge0标签交换路径 |
从 PE2 到 PE1 的标签交换路径。 |
连接关联 | 说明 |
---|---|
ccc-macsec |
在将站点 A 连接到站点 B 的 CCC 上启用 MACsec 的连接关联。 连接关联在以下接口上已启用:
|
网桥域 | 说明 |
---|---|
macsec |
将站点 A 用户与 B 站点用户之间的流量定向到 MACsec 安全 CCC 的 VLAN。 网桥域包括以下接口:
|
配置 MPLS
本节介绍如何在 MPLS 网络中的每台路由器上配置 MPLS。
其中包含以下部分:
在 PE1 上配置 MPLS
CLI 快速配置
要快速配置 PE1 路由器上的 MPLS 配置,请使用以下命令:
[edit] set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 set protocols mpls label-switched-path lsp_to_pe2_xe1 to 130.1.1.3 set protocols mpls interface ge-0/0/1.0 set protocols rsvp interface lo0.0 set protocols rsvp interface ge-0/0/1.0 set interfaces lo0 unit 0 family inet address 130.1.1.1/32 set interfaces ge-0/0/1 unit 0 family inet address 10.1.5.2/24 set interfaces ge-0/0/1 unit 0 family mpls set interfaces ge-0/0/0 unit 0 family ccc set protocols connections remote-interface-switch ge-1-to-pe2 interface ge-0/0/0.0 set protocols connections remote-interface-switch ge-1-to-pe2 transmit-lsp lsp_to_pe2_xe1 set protocols connections remote-interface-switch ge-1-to-pe2 receive-lsp lsp_to_pe1_ge0
逐步过程
在路由器 PE1 上配置 MPLS:
配置 OSPF 并启用流量工程:
[edit protocols] user@router-PE1# set ospf traffic-engineering
在环路地址和核心接口上配置 OSPF:
[edit protocols] user@router-PE1# set ospf area 0.0.0.0 interface lo0.0 user@router-PE1# set ospf area 0.0.0.0 interface ge-0/0/1.0
在此路由器 PE1 上配置 MPLS,并配置 PE2 路由器的 LSP:
[edit protocols] user@router-PE1# set mpls label-switched-path lsp_to_pe2_xe1 to 130.1.1.3
在核心接口上配置 MPLS:
[edit protocols] user@router-PE1# set mpls interface ge-0/0/1.0
在环路接口和核心接口上配置 RSVP:
[edit protocols] user@router-PE1# set rsvp interface lo0.0 user@router-PE1# set rsvp interface ge-0/0/1.0
配置环路接口和核心接口的 IP 地址:
[edit] user@router-PE1# set interfaces lo0 unit 0 family inet address 130.1.1.1/32 user@router-PE1# set interfaces ge-0/0/1 unit 0 family inet address 10.1.5.2/24
在核心接口地址的逻辑单元上进行配置
family mpls
:[edit] user@router-PE1# set interfaces ge-0/0/1 unit 0 family mpls
将客户边缘接口的逻辑单元配置为 CCC:
[edit interfaces ge-0/0/0 unit 0] user@PE-1# set family ccc
配置从 PE1 到 PE2 的基于接口的 CCC:
[edit protocols] user@PE-1# set connections remote-interface-switch ge-1-to-pe2 interface ge-0/0/0.0 user@PE-1# set connections remote-interface-switch ge-1-to-pe2 transmit-lsp lsp_to_pe2_xe1 user@PE-1# set connections remote-interface-switch ge-1-to-pe2 receive-lsp lsp_to_pe1_ge0
结果
显示配置结果:
user@PE-1> show configuration
interfaces { ge-0/0/0 { unit 0 { family ccc; } } ge-0/0/1{ unit 0 { family inet { address 130.1.5.2/24; } family mpls; } } lo0 { unit 0 { family inet { address 130.1.1.1/32; } } } } protocols { rsvp { interface lo0.0; interface ge-0/0/1.0; } mpls { label-switched-path lsp_to_pe2_xe1 { to 130.1.1.3; } interface ge-0/0/1.0; } ospf { traffic-engineering; area 0.0.0.0 { interface lo0.0; interface ge-0/0/1.0; } } connections { remote-interface-switch ge-1-to-pe2 { interface ge-0/0/0.0; transmit-lsp lsp_to_pe2_xe1; receive-lsp lsp_to_pe1_ge0; } } }
在提供商路由器上配置 MPLS
CLI 快速配置
要快速配置提供商路由器上的 MPLS 配置,请使用以下命令:
[edit] set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ospf area 0.0.0.0 interface ge-0/0/10.0 set protocols ospf area 0.0.0.0 interface xe-0/0/0.0 set protocols mpls interface ge-0/0/10.0 set protocols mpls interface xe-0/0/0.0 set protocols mpls label-switched-path lsp_to_pe2_xe1 to 130.1.1.3 set protocols rsvp interface lo0.0 set protocols rsvp interface ge-0/0/10.0 set protocols rsvp interface xe-0/0/0.0 set interfaces lo0 unit 0 family inet address 130.1.1.2/32 set interfaces ge-0/0/10 unit 0 family inet address 10.1.5.1/24 set interfaces ge-0/0/10 unit 0 family mpls set interfaces xe-0/0/0 unit 0 family inet address 10.1.9.1/24 set interfaces xe-0/0/0 unit 0 family mpls
逐步过程
要配置提供商路由器:
配置 OSPF 并启用流量工程:
[edit protocols] user@router-P# set ospf traffic-engineering
在环路接口和核心接口上配置 OSPF:
[edit protocols] user@router-P# set ospf area 0.0.0.0 interface lo0.0 user@router-P# set ospf area 0.0.0.0 interface ge-0/0/10.0 user@router-P# set ospf area 0.0.0.0 interface xe-0/0/0.0
在路由器上的核心接口上配置 MPLS:
[edit protocols] user@router-P# set mpls interface ge-0/0/10.0 user@router-P# set mpls interface xe-0/0/0.0
在环路接口和核心接口上配置 RSVP:
[edit protocols] user@router-P# set rsvp interface lo0.0 user@router-P# set rsvp interface ge-0/0/10.0 user@router-P# set rsvp interface xe-0/0/0.0
配置环路接口和核心接口的 IP 地址:
[edit] user@router-P# set interfaces lo0 unit 0 family inet address 130.1.1.2/32 user@router-P# set interfaces ge-0/0/10 unit 0 family inet address 10.1.5.1/24 user@router-P# set interfaces xe-0/0/0 unit 0 family inet address 10.1.9.1/24
在核心接口地址的逻辑单元上进行配置
family mpls
:[edit] user@router-P# set interfaces ge-0/0/10 unit 0 family mpls user@router-P# set interfaces xe-0/0/0 unit 0 family mpls
将 LSP 配置为 PE2 路由器:
[edit] user@router-P# set protocols mpls label-switched-path lsp_to_pe2_xe1 to 130.1.1.3
结果
显示配置结果:
user@router-P> show configuration
interfaces { ge-0/0/10 { unit 0 { family inet { address 10.1.5.1/24; } family mpls; } } xe-0/0/0 { unit 0 { family inet { address 10.1.9.1/24; } family mpls; } } lo0 { unit 0 { family inet { address 130.1.1.2/32; } } } } protocols { rsvp { interface lo0.0; interface ge-0/0/10.0; interface xe-0/0/0.0; } mpls { label-switched-path lsp_to_pe2_xe1 { to 130.1.1.3; } interface ge-0/0/10.0; interface xe-0/0/0.0; } ospf { traffic-engineering; area 0.0.0.0 { interface lo0.0; interface ge-0/0/10.0; interface xe-0/0/0.0; } } }
在 PE2 上配置 MPLS
CLI 快速配置
要快速配置路由器 PE2 上的 MPLS 配置,请使用以下命令:
[edit] set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ospf area 0.0.0.0 interface xe-0/1/0.0 set protocols mpls label-switched-path lsp_to_pe1_ge0 to 130.1.1.1 set protocols mpls interface xe-0/1/0.0 set protocols rsvp interface lo0.0 set protocols rsvp interface xe-0/1/0.0 set interfaces lo0 unit 0 family inet address 130.1.1.3/32 set interfaces xe-0/1/0 unit 0 family inet address 10.1.9.2/24 set interfaces xe-0/1/0 unit 0 family mpls set interfaces xe-0/1/1 unit 0 family ccc set protocols connections remote-interface-switch xe-1-to-pe1 interface xe-0/1/1.0 set protocols connections remote-interface-switch xe-1-to-pe1 transmit-lsp lsp_to_pe1_ge0 set protocols connections remote-interface-switch xe-1-to-pe1 receive-lsp lsp_to_pe2_xe1
逐步过程
要配置路由器 PE2:
配置 OSPF 并启用流量工程:
[edit protocols] user@router-PE2# set ospf traffic-engineering
在环路接口和核心接口上配置 OSPF:
[edit protocols] user@router-PE2# set ospf area 0.0.0.0 interface lo0.0 user@router-PE2# set ospf area 0.0.0.0 interface xe-0/1/0.0
在此路由器 (PE2) 上配置 MPLS,使用标签交换路径 (LSP) 配置到其他 PE 路由器 (PE1):
[edit protocols] user@router-PE2# set mpls label-switched-path lsp_to_pe1_ge0 to 130.1.1.1
在核心接口上配置 MPLS:
[edit protocols] user@router-PE2# set mpls interface xe-0/1/0.0
在环路接口和核心接口上配置 RSVP:
[edit protocols] user@router-PE2# set rsvp interface lo0.0 user@router-PE2# set rsvp interface xe-0/1/0.0
配置环路接口和核心接口的 IP 地址:
[edit] user@router-PE2# set interfaces lo0 unit 0 family inet address 130.1.1.3/32 user@router-PE2# set interfaces xe-0/1/0 unit 0 family inet address 10.1.9.2/24
在核心接口的逻辑单元上配置
family mpls
:[edit] user@router-PE2# set interfaces xe-0/1/0 unit 0 family mpls
将客户边缘接口的逻辑单元配置为 CCC:
[edit interfaces xe-0/1/1 unit 0] user@router-PE2# set family ccc
在主边缘路由器之间配置基于接口的 CCC:
[edit protocols] user@router-PE2# set connections remote-interface-switch xe-1-to-pe1 interface xe-0/1/1.0 user@router-PE2# set connections remote-interface-switch xe-1-to-pe1 transmit-lsp lsp_to_pe1_ge0 user@router-PE2# set connections remote-interface-switch xe-1-to-pe1 receive-lsp lsp_to_pe2_xe1
结果
显示配置结果:
user@router-PE2> show configuration
interfaces { xe-0/1/0 { unit 0 { family inet { address 10.1.9.2/24; } family mpls; } } xe-0/1/1 { unit 0 { family ccc; } } lo0 { unit 0 { family inet { address 130.1.1.3/32; } } } } protocols { rsvp { interface lo0.0; interface xe-0/1/0.0; } mpls { label-switched-path lsp_to_pe1_ge0 { to 130.1.1.1; } interface xe-0/1/0.0; } ospf { traffic-engineering; area 0.0.0.0 { interface lo0.0; interface xe-0/1/0.0; } } connections { remote-interface-switch xe-1-to-pe1 { interface xe-0/1/1.0; transmit-lsp lsp_to_pe1_ge0; receive-lsp lsp_to_pe2_xe1; } } }
配置 MACsec
本节介绍如何在拓扑中的每台路由器上配置 MACsec。
其中包含以下部分:
在站点 A CE 路由器上配置 MACsec,以保护到站点 B 的流量安全
CLI 快速配置
[edit] set security macsec connectivity-association ccc-macsec security-mode static-cak set security macsec connectivity-association ccc-macsec pre-shared-key ckn 37c9c2c45ddd012aa5bc8ef284aa23ff6729ee2e4acb66e91fe34ba2cd9fe311 set security macsec connectivity-association ccc-macsec pre-shared-key cak 228ef255aa23ff6729ee664acb66e91f set security macsec interfaces ge-0/0/0 connectivity-association ccc-macsec
逐步过程
在此示例中,经常交换财务敏感数据的用户之间的流量通过 MPLS 云在 CCC 上的站点之间发送。通过在连接到 MPLS PE 路由器的站点 A 和站点 B CE 路由器上的接口上配置 MACsec 连接关联,在 CCC 上启用 MACsec。连接关联必须具有匹配的连接关联名称(在本示例中 ccc-macsec)、匹配的CKN(在此示例中 37c9c2c45ddd012aa5bc8ef284aa23ff6729ee2e4acb66e91fe34ba2cd9fe311)和 CAK(在此示例中 228ef255aa23ff6729ee664acb66e91f)才能建立 MACsec 安全连接。
要对将站点 A 连接到站点 B 的 CCC 启用 MACsec,请对站点 A CE 路由器执行以下过程:
创建名为 ccc-macsec的连接关联,并将 MACsec 安全模式
static-cak
配置为:[edit security macsec] user@router-CE-A# set connectivity-association ccc-macsec security-mode static-cak
通过配置 CKN 和 CAK 创建预共享密钥:
[edit security macsec] user@router-CE-A# set connectivity-association ccc-macsec pre-shared-key ckn 37c9c2c45ddd012aa5bc8ef284aa23ff6729ee2e4acb66e91fe34ba2cd9fe311 user@router-CE-A# set connectivity-association ccc-macsec pre-shared-key cak 228ef255aa23ff6729ee664acb66e91f
将连接关联分配给连接到 PE1 路由器的接口:
[edit security macsec] user@router-CE-A# set interfaces ge-0/0/0 connectivity-association ccc-macsec
这将完成在 CCC 的一端配置连接关联的步骤。在链路的另一端启用了与匹配的预共享密钥的连接关联之前,MACsec 不会启用,此链路是 CCC 站点 B CE 路由器上的接口。下一节介绍了在站点 B CE 路由器上配置连接关联的过程。
结果
显示配置结果:
user@router-CE-A> show configuration
security { macsec { connectivity-association { ccc-macsec { pre-shared-key { cak "$9$rJ-lWLxNdw24Xxik.PQzreK"; ## SECRET-DATA ckn 37c9c2c45ddd012aa5bc8ef284aa23ff6729ee2e4acb66e91fe34ba2cd9fe311; } security-mode { static-cak; } } } interfaces { ge-0/0/0 { connectivity-association { ccc-macsec; } } } } }
在站点 B CE 路由器上配置 MACsec,以保护到站点 A 的流量
CLI 快速配置
[edit] set security macsec connectivity-association ccc-macsec security-mode static-cak set security macsec connectivity-association ccc-macsec pre-shared-key ckn 37c9c2c45ddd012aa5bc8ef284aa23ff6729ee2e4acb66e91fe34ba2cd9fe311 set security macsec connectivity-association ccc-macsec pre-shared-key cak 228ef255aa23ff6729ee664acb66e91f set security macsec interfaces xe-0/1/0 connectivity-association ccc-macsec
逐步过程
流量使用 CCC 通过 MPLS 网络从站点 B 传输到站点 A。通过在连接到 MPLS PE 路由器的站点 A 和站点 B CE 路由器上的接口上配置 MACsec 连接关联,在 CCC 上启用 MACsec。连接关联必须具有匹配的连接关联名称(在此示例中 ccc-macsec)、匹配的CKN (37c9c2c45ddd012aa5bc8ef284aa23ff6729ee2e4acb66e91fe34ba2cd9fe311) 和匹配的 CAK (228ef255aa23ff6729ee664acb66e91f),才能建立 MACsec 安全连接。
要启用将站点 B 连接到站点 A 的 CCC 上的 MACsec,请对站点 B CE 路由器执行以下过程:
创建名为 ccc-macsec的连接关联,并将 MACsec 安全模式
static-cak
配置为:[edit security macsec] user@router-CE-B# set connectivity-association ccc-macsec security-mode static-cak
通过配置 CKN 和 CAK 创建预共享密钥:
[edit security macsec] user@router-CE-B# set connectivity-association ccc-macsec pre-shared-key ckn 37c9c2c45ddd012aa5bc8ef284aa23ff6729ee2e4acb66e91fe34ba2cd9fe311 user@router-CE-B# set connectivity-association ccc-macsec pre-shared-key cak 228ef255aa23ff6729ee664acb66e91f
将连接关联分配给连接到路由器 PE2 的接口:
[edit security macsec] user@router-CE-B# set interfaces xe-0/1/0 connectivity-association ccc-macsec
在交换预共享密钥后(在完成此过程后不久),为 CCC 启用 MACsec。
结果
显示配置结果:
user@router-CE-B> show configuration
security { macsec { connectivity-association { ccc-macsec { security-mode { static-cak; } pre-shared-key { cak "$9$rJ-lWLxNdw24Xxik.PQzreK"; ## SECRET-DATA ckn 37c9c2c45ddd012aa5bc8ef284aa23ff6729ee2e4acb66e91fe34ba2cd9fe311; } } } interfaces { xe-0/1/0 { connectivity-association { ccc-macsec; } } } } }
配置 VLAN 以将流量定向到 MACsec 安全 CCC
本节介绍如何在站点 A 和站点 B CE 路由器上配置 VLAN。VLAN 的目的是将您希望受 MACsec 保护的流量定向到 MACsec 安全 CCC 上。
配置网桥域以将流量定向到站点 A CE 路由器上的 MACsec CCC
CLI 快速配置
[edit] set interfaces ge-0/0/0 unit 0 encapsulation vlan-bridge set interfaces ge-0/0/0 unit 0 family bridge set interfaces ge-0/0/2 unit 0 encapsulation vlan-bridge set interfaces ge-0/0/2 unit 0 family bridge set bridge-domains macsec vlan-id 50 set bridge-domains macsec domain-type bridge set bridge-domains macsec vlan-id all set bridge-domains macsec interface ge-0/0/0 set bridge-domains macsec interface ge-0/0/2 set interfaces irb vlan-id 50 family inet address 5.5.5.1/24
逐步过程
要创建一个桥接域(VLAN ID 50),以便将来自站点 A 的用户的流量定向到 MACsec 安全 CCC 上:
使用 VLAN 封装和网桥系列配置 ge-0/0/0 接口。
user@router-CE-A# set interfaces ge-0/0/0 unit 0 encapsulation vlan-bridge user@router-CE-A# set interfaces ge-0/0/0 unit 0 family bridge vlan-id 50
使用 VLAN 封装和网桥系列配置 ge-0/0/2 接口。
[edit] user@router-CE-A#set interfaces ge-0/0/2 unit 0 encapsulation vlan-bridge user@router-CE-A#set interfaces ge-0/0/2 unit 0 family bridge vlan-id 50
定义 macsec 网桥域并将接口 ge-0/0/0 和 ge-0/0/2 与网桥域相关联。
[edit] user@router-CE-A# set bridge-domains macsec vlan-id 50 user@router-CE-A# set bridge-domains macsec domain-type bridge user@router-CE-A# set bridge-domains macsec interface ge-0/0/0 user@router-CE-A# set bridge-domains macsec interface ge-0/0/2
为 macsec 网桥域创建 IP 地址:
[edit] user@router-CE-A# set interfaces irb vlan-id 50 family inet address 5.5.5.1/24
结果
显示配置结果:
user@router-CE-A> show configuration interfaces { ge-0/0/0 { unit 0 { encapsulation vlan-bridge; family bridge { vlan-id 50; } } } ge-0/0/2 { unit 0 { encapsulation vlan-bridge; family bridge { vlan-id 50; } } } irb { vlan-id 50 { family inet address 5.5.5.1/24; } } } bridge-domains { macsec { domain-type bridge; vlan-id 50; interface ge-0/0/0; interface ge-0/0/2; } }
配置网桥域以将流量定向到站点 B CE 路由器上的 MACsec CCC
CLI 快速配置
[edit] set interfaces xe-0/1/0 unit 0 encapsulation vlan-bridge set interfaces xe-0/1/0 unit 0 family bridge set interfaces ge-0/0/2 unit 0 encapsulation vlan-bridge set interfaces ge-0/0/2 unit 0 family bridge set bridge-domains macsec vlan-id 50 set bridge-domains macsec domain-type bridge set bridge-domains macsec vlan-id all set bridge-domains macsec interface ge-0/0/2 set bridge-domains macsec interface xe-0/1/0 set interfaces irb vlan-id 50 family inet address 5.5.5.2/24
逐步过程
要创建桥接域(VLAN ID 50)以将站点 B 上的用户的流量定向到 MACsec 安全 CCC 上:
使用 VLAN 封装和网桥系列配置 xe-0/1/0 接口。
user@router-CE-A# set interfaces xe-0/1/0 unit 0 encapsulation vlan-bridge user@router-CE-A# set interfaces xe-0/1/0 unit 0 family bridge vlan-id 50
使用 VLAN 封装和网桥系列配置 ge-0/0/2 接口。
[edit] user@router-CE-A#set interfaces ge-0/0/2 unit 0 encapsulation vlan-bridge user@router-CE-A#set interfaces ge-0/0/2 unit 0 family bridge vlan-id 50
定义 macsec 网桥域并将接口 xe-0/1/0 和 ge-0/0/2 与网桥域相关联。
[edit] user@router-CE-A# set bridge-domains macsec vlan-id 50 user@router-CE-A# set bridge-domains macsec domain-type bridge user@router-CE-A# set bridge-domains macsec interface xe-0/1/0 user@router-CE-A# set bridge-domains macsec interface ge-0/0/2
为 macsec 网桥域创建 IP 地址:
[edit] user@router-CE-A# set interfaces irb vlan-id 50 family inet address 5.5.5.2/24
结果
显示配置结果:
user@router-CE-B> show configuration interfaces { ge-0/0/2 { unit 0 { encapsulation vlan-bridge; family bridge { vlan-id 50; } } } xe-0/1/0 { unit 0 { encapsulation vlan-bridge; family bridge { vlan-id 50; } } } irb { vlan-id 50 { family inet address 5.5.5.2/24; } } } bridge-domains { macsec { domain-type bridge; vlan-id 50; interface xe-0/1/0; interface ge-0/0/2; } }
验证
要确认配置工作正常,请执行以下任务:
- 验证 MACsec 连接
- 验证 MACsec 安全流量是否正在遍历 CCC
- 验证提供商边缘和提供商交换机接口上是否启用了 MPLS 和 CCC 协议
- 验证 MPLS 标签操作
- 验证 MPLS CCC 的状态
- 验证 OSPF 操作
- 验证 RSVP 会话的状态
验证 MACsec 连接
目的
验证 MACsec 是否在 CCC 上运行。
行动
在 show security macsec connections
一台或两台客户边缘 (CE) 交换机上输入命令。
user@router-CE-A> show security macsec connections
Interface name: ge-0/0/0
CA name: ccc-macsec
Cipher suite: GCM-AES-128 Encryption: on
Key server offset: 0 Include SCI: no
Replay protect: off Replay window: 0
Outbound secure channels
SC Id: 00:19:E2:53:CD:F3/1
Outgoing packet number: 9785
Secure associations
AN: 0 Status: inuse Create time: 2d 20:47:54
Inbound secure channels
SC Id: 00:23:9C:0A:53:33/1
Secure associations
AN: 0 Status: inuse Create time: 2d 20:47:54
意义
Interface name:
和CA name:
输出表明,ccc-macsec 连接关联在接口 ge-0/0/0 上运行。当接口上无法运行连接关联时,输出不会显示。
如需进一步验证 MACsec 在 CCC 上是否正常运行,您还可以在其他 CE 交换机上输入 show security macsec connections
命令。
验证 MACsec 安全流量是否正在遍历 CCC
目的
验证遍历 CCC 的流量是否为 MACsec 安全。
行动
在 show security macsec statistics
一台或两台 CE 交换机上输入命令。
user@router-CE-A> show security macsec statistics
Interface name: ge-0/0/0
Secure Channel transmitted
Encrypted packets: 9784
Encrypted bytes: 2821527
Protected packets: 0
Protected bytes: 0
Secure Association transmitted
Encrypted packets: 9784
Protected packets: 0
Secure Channel received
Accepted packets: 9791
Validated bytes: 0
Decrypted bytes: 2823555
Secure Association received
Accepted packets: 9791
Validated bytes: 0
Decrypted bytes: 2823555
意义
Encrypted packets
每次从通过 MACsec 进行安全和加密的接口发送数据包时,输出下的Secure Channel transmitted
线路都会递增。Encrypted packets
输出显示,已有 9784 个加密的安全数据包从接口 ge-0/0/0 传输。因此,MACsec 安全流量在接口 ge-0/0/0 上发送。
Accepted packets
每次接口上接收通过 MACsec 完整性检查的数据包时,输出下的Secure Association received
线路都会递增。Decrypted bytes
每次接收并解密加密数据包时,Secure Association received
输出下的行都会递增。输出显示,在接口 ge-0/0/0/0 上接收了 9791 个 MACsec 安全数据包,并且成功解密了来自这些数据包的 2823555 个字节。因此,在接口 ge-0/0/0/0 上接收 MACsec 安全流量。
如需其他验证,您还可以在其他 CE 交换机上输入 show security macsec statistics
命令。
验证提供商边缘和提供商交换机接口上是否启用了 MPLS 和 CCC 协议
目的
验证 PE 和提供商交换机的正确接口上是否启用了 MPLS。
行动
在 show interfaces terse
PE 路由器和提供商交换机上输入命令:
user@router-PE1> show interfaces terse
Interface Admin Link Proto Local Remote
ge-0/0/0 up up
ge-0/0/0.0 up up ccc
ge-0/0/1 up up
ge-0/0/1.0 up up inet 10.1.5.2/24
mpls
<some output removed for brevity>
user@router-P> show interfaces terse
Interface Admin Link Proto Local Remote
xe-0/0/0 up up
xe-0/0/0.0 up up inet 10.1.9.1/24
mpls
ge-0/0/10 up up
ge-0/0/10.0 up up inet 10.1.5.1/24
mpls
<some output removed for brevity>
user@router-PE2> show interfaces terse
Interface Admin Link Proto Local Remote
xe-0/1/0 up up
xe-0/1/0.0 up up inet 10.1.9.2/24
mpls
xe-0/1/1 up up
xe-0/1/1.0 up up ccc
<some output removed for brevity>
意义
输出确认,MPLS 协议已适用于传递 MPLS 流量的提供商交换机接口(xe-0/0/0 和 ge-0/0/10),以及传递 MPLS 流量的 PE 路由器接口(PE1 交换机上的接口 ge-0/0/1 和 PE2 路由器上的接口 xe-0/1/0)。
输出还确认在面向 CE 交换机的 PE 路由器接口上启用了 CCC,即 PE1 交换机上的接口 ge-0/0/0 和 PE2 路由器上的接口 xe-0/1/1。
验证 MPLS 标签操作
目的
验证使用哪个接口作为 CCC 的开头,以及正在使用哪个接口将 MPLS 数据包推送到下一跃点。
行动
进入一 show route forwarding-table family mpls
个或两个 PE 路由器。
user@router-PE1> show route forwarding-table family mpls
Routing table: default.mpls
MPLS:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 dscd 50 1
0 user 0 recv 49 4
1 user 0 recv 49 4
2 user 0 recv 49 4
13 user 0 recv 49 4
299856 user 0 Pop 1327 2 ge-0/0/0.0
ge-0/0/0.0 (CCC) user 0 10.1.5.1 Push 299952 1328 2 ge-0/0/1.0
意义
此输出确认 CCC 配置在接口 ge-0/0/0.0 上。交换机在 ge-0/0/1.0 上接收入口流量,并将标签299952推送到数据包上,数据包通过接口 ge-0/0/0/1.0 退出交换机。输出还显示,当交换机收到带有299856标签的 MPLS 数据包时,会弹出该标签并通过接口 ge-0/0/0.0 发送数据包
如需进一步验证 MPLS 标签操作,请输入其他 PE 路由器上的地址 show route forwarding-table family mpls
。
验证 MPLS CCC 的状态
目的
验证 MPLS CCC 是否正常运行。
行动
在 show connections
PE 路由器上输入命令。
user@router-PE1> show connections
CCC and TCC connections [Link Monitoring On]
Legend for status (St): Legend for connection types:
UN -- uninitialized if-sw: interface switching
NP -- not present rmt-if: remote interface switching
WE -- wrong encapsulation lsp-sw: LSP switching
DS -- disabled tx-p2mp-sw: transmit P2MP switching
Dn -- down rx-p2mp-sw: receive P2MP switching
-> -- only outbound conn is up Legend for circuit types:
<- -- only inbound conn is up intf -- interface
Up -- operational oif -- outgoing interface
RmtDn -- remote CCC down tlsp -- transmit LSP
Restart -- restarting rlsp -- receive LSP
Connection/Circuit Type St Time last up # Up trans
ge-1-to-pe2 rmt-if Up May 30 19:01:45 1
ge-0/0/0.0 intf Up
lsp_to_pe2_xe1 tlsp Up
lsp_to_pe1_ge0 rlsp Up
user@router-PE2> show connections
CCC and TCC connections [Link Monitoring On]
Legend for status (St): Legend for connection types:
UN -- uninitialized if-sw: interface switching
NP -- not present rmt-if: remote interface switching
WE -- wrong encapsulation lsp-sw: LSP switching
DS -- disabled tx-p2mp-sw: transmit P2MP switching
Dn -- down rx-p2mp-sw: receive P2MP switching
-> -- only outbound conn is up Legend for circuit types:
<- -- only inbound conn is up intf -- interface
Up -- operational oif -- outgoing interface
RmtDn -- remote CCC down tlsp -- transmit LSP
Restart -- restarting rlsp -- receive LSP
Connection/Circuit Type St Time last up # Up trans
xe-1-to-pe1 rmt-if Up May 30 09:39:15 1
xe-0/1/1.0 intf Up
lsp_to_pe1_ge0 tlsp Up
lsp_to_pe2_xe1 rlsp Up
命令 show connections
显示 CCC 连接的状态。此输出可验证 CCC 接口及其关联的传输和接收 LSP 是否位于 Up
两个 PE 路由器上。
验证 OSPF 操作
目的
验证 OSPF 是否正在运行。
行动
在 show ospf neighbor
提供商或 PE 路由器上输入命令,并检查 State
输出。
user@router-P> show ospf neighbor
Address Interface State ID Pri Dead
10.1.5.2 ge-0/0/10.0 Full 130.1.1.1 128 33
10.1.9.2 xe-0/0/0.0 Full 130.1.1.3 128 38
意义
输出 State
在使用 OSPF 的所有接口上, Full
因此 OSPF 可以正常运行。
有关 OSPF 的进一步验证,除了 show ospf neighbor
提供商交换机外,还对 PE 路由器输入命令。
验证 RSVP 会话的状态
目的
验证 RSVP 会话的状态。
行动
show rsvp session
输入命令,并验证每个 RSVP 会话的状态是否已启动。
user@router-P> show rsvp session
Ingress RSVP: 0 sessions
Total 0 displayed, Up 0, Down 0
Egress RSVP: 0 sessions
Total 0 displayed, Up 0, Down 0
Transit RSVP: 2 sessions
To From State Rt Style Labelin Labelout LSPname
130.1.1.1 130.1.1.3 Up 0 1 FF 299936 299856 lsp_to_pe1_ge0
130.1.1.3 130.1.1.1 Up 0 1 FF 299952 299840 lsp_to_pe2_xe1
Total 2 displayed, Up 2, Down 0
意义
所有 State
连接均 Up
使用,因此 RSVP 运行正常。
如需进一步验证,除了 show rsvp session
提供商路由器外,还输入 PE 路由器上的地址。