基本 MPLS 配置
MPLS 配置概述
首次在设备上安装 Junos OS 时,MPLS 默认处于禁用状态。您必须显式配置设备以允许 MPLS 流量通过。对于 MPLS 网络中运行 Junos OS 的所有设备,请完成以下步骤。
要启用 MPLS,请执行以下操作:
当数据包转发模式更改为 MPLS 时,所有基于流的安全功能都将停用,设备仅执行基于数据包的处理。基于流的服务(如安全策略、区域、NAT、ALG、机箱群集、屏幕、防火墙身份验证和 IPsec VPN)在设备上不可用。但是,可以使用防火墙过滤器在基于流的数据包转发模式下为所选流量启用 MPLS。
MPLS 配置准则
在 QFX 系列设备或 EX4600 上配置 MPLS 时,请注意支持的 IP 前缀数量取决于所使用的特定平台。有关更多信息,请参阅设备数据手册中的秤规格。
我们建议执行以下操作:
如果您的入口提供商边缘 (PE) 交换机需要支持 8000 个以上的外部 IP 前缀,请使用更大容量的设备作为入口 PE 交换机。
如果将交换机用作 BGP 标记路由的路由反射器,请将其用作专用路由反射器(即交换机不得参与管理数据流量)。
如果将交换机用作 PE 交换机或 BGP 标记路由的路由反射器,请在 PE 交换机和路由反射器上配置路由策略,以过滤路由表中的外部 IP 路由。
下面给出了名为 fib_policy 的路由策略(在
[edit policy-options
和[edit routing-options
层次结构级别)的配置示例,用于从 inet.0 路由表中过滤 BGP 标记的路由:user@switch# show policy-options policy-statement fib_policy { from { protocol bgp; rib inet.0; } then reject; }
user@switch# show routing-options forwarding-table { export fib_policy; }
QFX 系列设备或 EX4600 交换机不支持在层次结构级别使用该
[edit protocols mpls path-mtu]
语句进行allow-fragmentation
数据包分段。因此,您必须确保在每个 MPLS 接口上配置的最大传输单元 (MTU) 值足以处理 MPLS 数据包。大小超过接口 MTU 值的数据包将被丢弃。
配置 MPLS
您还必须配置 MPLS 才能使第 2 层交叉连接正常工作。以下是最低 MPLS 配置:
[edit] interfaces {interface-name
{ unitlogical-unit-number;
} } protocols { mpls { interface all; } }
示例:启用 MPLS
此示例说明如何为基于数据包的处理启用 MPLS。它还展示了如何在网络中的所有传输接口上启用 MPLS 系列和 MPLS 进程。
要求
开始之前,请删除所有已配置的安全服务。请参阅 示例:删除安全服务。
概述
本主题中的说明介绍如何在设备上启用 MPLS。必须先在设备上启用 MPLS,然后才能在 MPLS 网络中包括运行 Junos OS 的设备。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到 [edit]
层级的 CLI 中,然后从配置模式进入 commit
。
set interfaces ge-1/0/0 unit 0 family mpls set protocols mpls ge-1/0/0 unit 0
分步过程
下面的示例要求您在各个配置层级中进行导航。有关操作说明,请参阅在配置模式下使用 CLI 编辑器。
要启用 MPLS,请执行以下操作:
在要包含在 MPLS 网络中的每个中转接口上启用 MPLS 系列。
[edit interfaces] user@host# set interfaces ge-1/0/0 unit 0 family mpls
在 MPLS 网络中的所有传输接口上启用 MPLS 进程。
[edit protocols mpls] user@host# set interface ge-1/0/0 unit 0
此外,对于安全设备,启用 MPLS 进行 packet-based 处理。对于路由和交换设备,请跳过此步骤。
[edit security forwarding-options] user@host# set family mpls mode packet-based
注:启用 MPLS 后,将停用所有基于流的安全功能,设备将执行基于数据包的处理。基于流的服务(如安全策略、区域、NAT、ALG、机箱群集、屏幕、防火墙身份验证、IP 数据包和 IPsec VPN)在设备上不可用。
在从流模式更改为数据包模式之前,必须删除流模式下剩余的所有安全策略。为防止管理连接丢失,您必须将管理接口绑定到区域并启用主机入站流量以防止设备失去连接。
有关配置区域的信息,请参阅 安全设备安全策略用户指南。
结果
如果完成设备配置,请从配置模式输入 commit
。
验证
确认配置工作正常。
验证是否启用了基于数据包的处理
目的
特定于安全设备,验证是否启用了基于数据包的处理。
操作
在操作模式下,输入 show security forwarding-options 命令。
user@host> show security forwarding-options family { mpls { mode packet-based; } }
如果使用命令 set security forward-option family mpls mode packet
启用 MPLS 进行基于数据包的处理,则模式不会立即更改,系统将显示以下消息:
警告:尝试重置流 inet 模式时可能需要重新启动
警告:尝试重置 MPLS 流模式时可能需要重新启动,请检查安全流状态以了解详细信息。
您需要重新启动设备才能使配置生效。
如果禁用 MPLS 并切换回使用安全服务(基于流的处理),则模式不会立即更改,系统将显示警告消息,指示您重新启动设备。您必须重新启动设备才能使配置生效。这也将导致重置管理会话和传输流量中断。
示例:在 EX8200 和 EX4500 交换机上配置 MPLS
您可以在交换机上配置 MPLS,以提高网络中的传输效率。MPLS 服务可用于将各个站点连接到骨干网络,并确保低延迟应用程序(如 IP 语音 (VoIP) 和其他关键业务功能)具有更好的性能。
要在交换机上实施 MPLS,您必须配置两台提供商边缘 (PE) 交换机(一台入口 PE 交换机和一台出口 PE 交换机)以及至少一台提供商(中转)交换机。您可以将 MPLS 网络的 PE 交换机上的客户边缘 (CE) 接口配置为电路交叉连接 (CCC) 或 IP (family inet) 接口。
此示例说明如何使用简单接口作为 CCC 来配置 MPLS 隧道:
此示例说明如何使用简单接口作为 CCC 来配置 MPLS。有关将标记的 VLAN 接口配置为 CCC 的信息,请参阅 使用第 2 层 VPN 配置基于 MPLS 的 VLAN CCC(CLI 过程) 或使用 第 2 层电路配置基于 MPLS 的 VLAN CCC。
要求
此示例使用以下硬件和软件组件:
适用于交换机的 Junos OS 10.1 或更高版本
三台 EX 系列交换机
开始配置 MPLS 之前,请确保已在核心接口上配置路由协议(OSPF 或 IS-IS),并在所有交换机上配置环路接口。此示例包括所有交换机上的 OSPF 配置。有关将 IS-IS 配置为路由协议的信息,请参阅 Junos OS 路由协议配置指南。
概述和拓扑
此示例包括一个入口或本地 PE 交换机、一个出口或远程 PE 交换机以及一个提供商交换机。它包括将本地 PE 交换机 (PE-1) 的客户边缘接口连接到远程 PE 交换机 (PE-2) 的客户边缘接口的 CCC。它还介绍了如何配置 PE 交换机和提供商交换机的核心接口以支持 MPLS 数据包的传输。在此示例中,连接本地 PE 交换机和提供商交换机的核心接口是单独的接口,而连接远程 PE 交换机和提供商交换机的核心接口是聚合以太网接口。
核心接口不能是标记的 VLAN 接口。
核心接口可以是聚合以太网接口。此示例包括提供商交换机和远程 PE 交换机之间的 LAG,因为这种类型的配置是您可以实施的另一个选项。有关配置 LAG 的信息,请参阅配置聚合以太网链路(CLI 过程)。
图 1 显示了此示例中使用的拓扑。

表 1 显示了此示例中用于入口 PE 交换机的 MPLS 配置组件。
属性 |
设置 |
Description |
---|---|---|
本地 PE 交换机硬件 |
EX 系列交换机 |
PE-1 |
环路地址 |
lo0 127.1.1.1/32 |
识别交换机间通信的 PE-1。 |
路由协议 |
ospf traffic-engineering |
指示此交换机正在使用 OSPF 作为路由协议,并且已启用流量工程。 |
MPLS 协议和标签交换路径的定义 |
mpls label-switched-path lsp_to_pe2_ge1 to 127.1.13 |
指示此 PE 交换机正在使用具有指定 LSP 的 MPLS 协议以访问其他 PE 交换机(由环路地址指定)。 该语句还必须指定要用于 MPLS 流量的核心接口。 |
RSVP |
rsvp |
指示此交换机正在使用 RSVP。该语句必须指定将用于 RSVP 会话的环路地址和核心接口。 |
接口系列 |
family inet family mpls family ccc |
核心接口的逻辑单元配置为同时属于 family inet 和 family mpls。 客户边缘接口的逻辑单元配置为属于 family ccc。 |
客户边缘接口 |
ge-0/0/1 |
将此网络连接到网络外部设备的接口。 |
核心接口 |
ge-0/0/5.0 以及 ge-0/0/6.0 IP 地址 10.1.5.1/24 和 10.1.6.1/24 |
连接到 MPLS 网络中其他交换机的接口。 |
CCC 定义 |
connections remote-interface-switch ge-1-to-pe2 interface ge-0/0/1.0 transmit-lsp lsp_to_pe2_ge1 receive-lsp lsp_to_pe1_ge1 |
将电路交叉连接 (CCC) ge-0/0/1与已在本地和远程 PE 交换机上定义的 LSP 相关联。 |
表 2 显示了此示例中用于出口 PE 交换机的 MPLS 配置组件。
属性 |
设置 |
Description |
---|---|---|
远程 PE 交换机硬件 |
EX 系列交换机 |
PE-2 |
环路地址 |
lo0 127.1.1.3/32 |
识别交换机间通信的 PE-2。 |
路由协议 |
ospf traffic-engineering |
指示此交换机正在使用 OSPF 作为路由协议,并且已启用流量工程。 |
MPLS 协议和标签交换路径的定义 |
mpls label-switched-path lsp_to_pe1_ge1 to 127.1.1.1 |
指示此 PE 交换机正在使用具有指定标签交换路径 (LSP) 的 MPLS 协议以访问其他 PE 交换机。 该语句还必须指定要用于 MPLS 流量的核心接口。 |
RSVP |
rsvp |
指示此交换机正在使用 RSVP。该语句必须指定将用于 RSVP 会话的环路地址和核心接口。 |
接口系列 |
family inet family mpls family ccc |
核心接口的逻辑单元配置为同时属于 family inet 和 family mpls。 客户边缘接口的逻辑单元配置为属于 family ccc。 |
客户边缘接口 |
ge-0/0/1 |
将此网络连接到网络外部设备的接口。 |
核心接口 |
ae0 带 IP 地址 10.1.9.2/24 |
PE-2 上的聚合以太网接口,连接到提供商交换机的聚合以太网接口 ae0 并属于 family mpls。 |
CCC 定义 |
connections remote-interface-switch ge-1-to-pe1 interface ge-0/0/1.0 transmit-lsp lsp_to_pe1_ge1; receive-lsp lsp_to_pe2_ge1; |
将 CCC ge-0/0/1与已在本地和远程 PE 交换机上定义的 LSP 相关联。 |
表 3 显示了此示例中用于提供商交换机的 MPLS 配置组件。
属性 |
设置 |
Description |
---|---|---|
提供商交换机硬件 |
EX 系列交换机 |
MPLS 网络配置中的中转交换机。 |
环路地址 |
lo0 127.1.1.2/32 |
标识交换机间通信的提供商交换机。 |
路由协议 |
ospf traffic-engineering |
指示此交换机正在使用 OSPF 作为路由协议,并且已启用流量工程。 |
MPLS 协议 |
mpls |
指示此交换机正在使用 MPLS 协议。 该语句必须指定将用于 MPLS 流量的核心接口。 |
RSVP |
rsvp |
指示此交换机正在使用 RSVP。该语句必须指定将用于 RSVP 会话的环路和核心接口。 |
接口系列 |
family inet family mpls |
环路接口和核心接口的逻辑单元属于 family inet。 核心接口的逻辑单元也配置为属于 family mpls。 |
核心接口 |
ge-0/0/5.0 以及 ge-0/0/6.0 IP 地址 10.1.5.1/24 和 10.1.6.1/24并 ae0 带有 IP 地址 10.1.9.1/24 |
将提供商交换机 (P) 连接到 PE-1 的接口。 P 上的聚合以太网接口,连接到 PE-2 的聚合以太网接口 ae0 。 |
配置本地 PE 交换机
程序
CLI 快速配置
要快速配置本地入口 PE 交换机,请复制以下命令并将其粘贴到 PE-1 的交换机终端窗口中:
[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/5.0 set protocols ospf area 0.0.0.0 interface ge-0/0/6.0 set protocols mpls label-switched-path lsp_to_pe2_ge1 to 127.1.1.3 set protocols mpls interface ge-0/0/5.0 set protocols mpls interface ge-0/0/6.0 set protocols rsvp interface lo0.0 set protocols rsvp interface ge-0/0/5.0 set protocols rsvp interface ge-0/0/6.0 set interfaces lo0 unit 0 family inet address 127.1.1.1/32 set interfaces ge-0/0/5 unit 0 family inet address 10.1.5.1/24 set interfaces ge-0/0/6 unit 0 family inet address 10.1.6.1/24 set interfaces ge-0/0/5 unit 0 family mpls set interfaces ge-0/0/6 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family ccc set protocols connections remote-interface-switch ge-1-to-pe2 interface ge-0/0/1.0 set protocols connections remote-interface-switch ge-1-to-pe2 transmit-lsp lsp_to_pe2_ge1 set protocols connections remote-interface-switch ge-1-to-pe2 receive-lsp lsp_to_pe1_ge1
分步过程
要配置本地入口 PE 交换机,请执行以下操作:
在启用流量工程的情况下配置 OSPF:
[edit protocols] user@switchPE-1# set ospf traffic-engineering
在环路地址和核心接口上配置 OSPF:
[edit protocols] user@switchPE-1# set ospf area 0.0.0.0 interface lo0.0 user@switchPE-1# set ospf area 0.0.0.0 interface ge-0/0/5.0 user@switchPE-1# set ospf area 0.0.0.0 interface ge-0/0/6.0
在此 PE 交换机 (PE-1) 上使用到其他 PE 交换机 (PE-2) 的标签交换路径 (LSP) 配置 MPLS:
[edit protocols] user@switchPE-1# set mpls label-switched-path lsp_to_pe2_ge1 to 127.1.1.3
在核心接口上配置 MPLS:
[edit protocols] user@switchPE-1# set mpls interface ge-0/0/5.0 user@switchPE-1# set mpls interface ge-0/0/6.0
在环路接口和核心接口上配置 RSVP:
[edit protocols] user@switchPE-1# set rsvp interface lo0.0 user@switchPE-1# set rsvp interface ge-0/0/5.0 user@switchPE-1# set rsvp interface ge-0/0/6.0
为环路接口和核心接口配置 IP 地址:
[edit] user@switchPE-1# set interfaces lo0 unit 0 family inet address 127.1.1.1/32 user@switchPE-1# set interfaces ge-0/0/5 unit 0 family inet address 10.1.5.1/24 user@switchPE-1# set interfaces ge-0/0/6 unit 0 family inet address 10.1.6.1/24
在核心接口地址的逻辑单元上配置 family mpls :
[edit] user@switchPE-1# set interfaces ge-0/0/5 unit 0 family mpls user@switchPE-1# set interfaces ge-0/0/6 unit 0 family mpls
将客户边缘接口的逻辑单元配置为 CCC:
[edit interfaces ge-0/0/1 unit 0] -user@PE-1# set family ccc
配置从 PE-1 到 PE-2 的基于接口的 CCC:
注:您还可以将标记的 VLAN 接口配置为 CCC。请参阅 使用第 2 层 VPN 配置基于 MPLS 的 VLAN CCC(CLI 过程) 或使用 第 2 层电路配置基于 MPLS 的 VLAN CCC。
[edit protocols] user@PE-1# set connections remote-interface-switch ge-1-to-pe2 interface ge-0/0/1.0 user@PE-1# set connections remote-interface-switch ge-1-to-pe2 transmit-lsp lsp_to_pe2_ge1 user@PE-1# set connections remote-interface-switch ge-1-to-pe2 receive-lsp lsp_to_pe1_ge1
结果
显示配置结果:
user@switchPE-1> show configuration
interfaces { ge-0/0/1 { unit 0 { family ccc; } } ge-0/0/5 { unit 0 { family inet { address 10.1.5.1/24; } family mpls; } } ge-0/0/6 { unit 0 { family inet { address 10.1.6.1/24; } family mpls; } } lo0 { unit 0 { family inet { address 127.1.1.1/32; } } } protocols { rsvp { interface lo0.0; interface ge-0/0/5.0; interface ge-0/0/6.0; } mpls { label-switched-path lsp_to_pe2_ge1 { to 127.1.1.3; } interface ge-0/0/5.0; interface ge-0/0/6.0; } ospf { traffic-engineering; area 0.0.0.0 { interface lo0.0; interface ge-0/0/5.0; interface ge-0/0/6.0; } } connections { remote-interface-switch ge-1-to-pe2 { interface ge-0/0/1.0; transmit-lsp lsp_to_pe2_ge1; receive-lsp lsp_to_pe1_ge1; } }
配置远程 PE 交换机
程序
CLI 快速配置
要快速配置远程 PE 交换机,请复制以下命令并将其粘贴到 PE-2 的交换机终端窗口中:
[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 ae0 set protocols mpls label-switched-path lsp_to_pe1_ge1 to 127.1.1.1 set protocols mpls interface ae0 set protocols rsvp interface lo0.0 set protocols rsvp interface ae0 set interfaces lo0 unit 0 family inet address 127.1.1.3/32 set interfaces ae0 unit 0 family inet address 10.1.9.2/24 set interfaces ae0 unit 0 family mpls set interfaces ge-0/0/1 unit 0 family ccc set protocols connections remote-interface-switch ge-1-to-pe1 interface ge-0/0/1.0 set protocols connections remote-interface-switch ge-1-to-pe1 transmit-lsp lsp_to_pe1_ge1 set protocols connections remote-interface-switch ge-1-to-pe1 receive-lsp lsp_to_pe2_ge1
分步过程
要配置远程 PE 交换机 (PE-2),请执行以下操作:
在启用流量工程的情况下配置 OSPF:
[edit protocols] user@switchPE-2# set ospf traffic-engineering
在环路接口和核心接口上配置 OSPF:
[edit protocols] user@switchPE-2# set ospf area 0.0.0.0 interface lo0.0 user@switchPE-2# set ospf area 0.0.0.0 interface ae0
在此交换机 (PE-2) 上使用到其他 PE 交换机 (PE-1) 的标签交换路径 (LSP) 配置 MPLS:
[edit protocols] user@switchPE-2# set mpls label-switched-path lsp_to_pe1_ge1 to 127.1.1.1
在核心接口上配置 MPLS:
[edit protocols] user@switchPE-2# set mpls interface ae0
在环路接口和核心接口上配置 RSVP:
[edit protocols] ser@switchPE-2# set rsvp interface lo0.0 user@switchPE-2# set rsvp interface ae0
为环路接口和核心接口配置 IP 地址:
[edit] user@switchPE-2# set interfaces lo0 unit 0 family inet address 127.1.1.3/32 user@switchPE-2# set interfaces ae0 unit 0 family inet address 10.1.9.2/24
在核心接口的逻辑单元上配置 family mpls :
[edit] user@switchPE-2# set interfaces ae0 unit 0 family mpls
将客户边缘接口的逻辑单元配置为 CCC:
[edit interfaces ge-0/0/1 unit 0] user@PE-2# set family ccc
配置从 PE-2 到 PE-1 的基于接口的 CCC:
[edit protocols] user@PE-2# set connections remote-interface-switch ge-1-to-pe1 interface ge-0/0/1.0 user@PE-2# set connections remote-interface-switch ge-1-to-pe1 transmit-lsp lsp_to_pe1_ge1 user@PE-2# set connections remote-interface-switch ge-1-to-pe1 receive-lsp lsp_to_pe2_ge1
结果
显示配置结果:
user@switchPE-2> show configuration
interfaces { ge-0/0/1 { unit 0 { family ccc; } } ae0 { unit 0 { family inet { address 10.1.9.2/24; } family mpls; } } lo0 { unit 0 { family inet { address 127.1.1.3/32; } } } } protocols { rsvp { interface lo0.0; interface ae0.0; } mpls { label-switched-path lsp_to_pe1_ge1 { to 127.1.1.1; } interface ae0.0; } ospf { traffic-engineering; area 0.0.0.0 { interface ae0.0; } } connections { remote-interface-switch ge-1-to-pe1 { interface ge-0/0/1.0; transmit-lsp lsp_to_pe1_ge1; receive-lsp lsp_to_pe2_ge1; } } }
配置提供商交换机
程序
CLI 快速配置
要快速配置提供商交换机,请复制以下命令并将其粘贴到交换机终端窗口中:
[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/5.0 set protocols ospf area 0.0.0.0 interface ge-0/0/6.0 set protocols ospf area 0.0.0.0 interface ae0 set protocols mpls interface ge-0/0/5.0 set protocols mpls interface ge-0/0/6.0 set protocols mpls interface ae0 set protocols rsvp interface lo0.0 set protocols rsvp interface ge-0/0/5.0 set protocols rsvp interface ge-0/0/6.0 set protocols rsvp interface ae0 set interfaces lo0 unit 0 family inet address 127.1.1.2/32 set interfaces ge-0/0/5 unit 0 family inet address 10.1.5.1/24 set interfaces ge-0/0/6 unit 0 family inet address 10.1.6.1/24 set interfaces ae0 unit 0 family inet address 10.1.9.1/24 set interfaces ge-0/0/5 unit 0 family mpls set interfaces ge-0/0/6 unit 0 family mpls set interfaces ae0 unit 0 family mpls
分步过程
要配置提供商交换机,请执行以下操作:
在启用流量工程的情况下配置 OSPF:
[edit protocols] user@switchP# set ospf traffic-engineering
在环路接口和核心接口上配置 OSPF:
[edit protocols] user@switchP# set ospf area 0.0.0.0 interface lo0.0 user@switchP# set ospf area 0.0.0.0 interface ge-0/0/5 user@switchP# set ospf area 0.0.0.0 interface ge-0/0/6 user@switchP# set ospf area 0.0.0.0 interface ae0
在交换机上的核心接口上配置 MPLS:
[edit protocols] user@switchP# set mpls interface ge-0/0/5 user@switchP# set mpls interface ge-0/0/6 user@switchP# set mpls interface ae0
在环路接口和核心接口上配置 RSVP:
[edit protocols] user@switchP# set rsvp interface lo0.0 user@switchP# set rsvp interface ge-0/0/5 user@switchP# set rsvp interface ge-0/0/6 user@switchP# set rsvp interface ae0
为环路接口和核心接口配置 IP 地址:
[edit] user@switchP# set interfaces lo0 unit 0 family inet address 127.1.1.2/32 user@switchP# set interfaces ge-0/0/5 unit 0 family inet address 10.1.5.1/24 user@switchP# set interfaces ge-0/0/6 unit 0 family inet address 10.1.6.1/24 user@switchP# set interfaces ae0 unit 0 family inet address 10.1.9.1/24
在核心接口地址的逻辑单元上配置 family mpls :
[edit] user@switchP# set interfaces ge-0/0/5 unit 0 family mpls user@switchP# set interfaces ge-0/0/6 unit 0 family mpls user@switchP# set interfaces ae0 unit 0 family mpls
结果
显示配置结果:
user@switchP> show configuration
interfaces { ge-0/0/5 { unit 0 { family inet { address 10.1.5.1/24; } family mpls; } } ge-0/0/6 { unit 0 { family inet { address 10.1.6.1/24; } family mpls; } } } ae0 { unit 0 { family inet { address 10.1.9.1/24; } family mpls; } } lo0 { unit 0 { family inet { address 127.1.1.2/32; } } } protocols { rsvp { interface lo0.0; interface ge-0/0/5.0; interface ge-0/0/6.0; interface ae0.0; } mpls { interface ge-0/0/5.0; interface ge-0/0/6.0; interface ae0.0; } ospf { traffic-engineering; area 0.0.0.0 { interface lo0.0; interface ge-0/0/5.0; interface ge-0/0/6.0; interface ae0.0; } }
验证
要确认配置工作正常,请执行以下任务:
验证交换机上的物理层
目的
验证接口是否已启动。在每台交换机上执行此验证任务。
操作
user@switchPE-1> show interfaces terse Interface Admin Link Proto Local Remote ge-0/0/0 up up ge-0/0/0.0 up up eth-switch ge-0/0/1 up up ge-0/0/1.0 up up ccc ge-0/0/2 up up ge-0/0/2.0 up up eth-switch ge-0/0/3 up up ge-0/0/3.0 up up eth-switch ge-0/0/4 up up ge-0/0/4.0 up up eth-switch ge-0/0/5 up up ge-0/0/5.0 up up inet 10.1.5.1/24 mpls ge-0/0/6 up up ge-0/0/6.0 up up inet 10.1.6.1/24 mpls
意义
该 show interfaces terse
命令显示交换机上千兆以太网接口的状态信息。此输出验证接口是否为 up。协议族(Proto 列)的输出显示接口 ge-0/0/1.0 配置为电路交叉连接。核心接口(ge-0/0/5.0 和 ge-0/0/6.0)的协议家族的输出显示这些接口同时配置为 inet 和 mpls。Local核心接口列显示为这些接口配置的 IP 地址。
验证路由协议
目的
验证配置的路由协议的状态。在每台交换机上执行此验证任务。状态必须是 Full.
操作
user@switchPE-1> show ospf neighbor Address Interface State ID Pri Dead 127.1.1.2 ge—0/0/5 Full 10.10.10.10 128 39
意义
该 show ospf neighbor
命令显示路由协议的状态。此输出显示状态 Full为 ,表示路由协议运行正常,也就是说,你好数据包正在直接连接的邻居之间交换。
验证用于 MPLS 流量的核心接口
目的
验证 MPLS 接口的状态是否为 Up。在每台交换机上执行此验证任务。
操作
user@switchPE-1> show mpls interface Interface State Administrative groups ge—0/0/5 Up <none> ge—0/0/6 Up <none>
意义
该 show mpls interface
命令将显示已配置为属于 family mpls的核心接口的状态。此输出显示配置为属于family mplsUp的接口为 。
验证 RSVP 会话的状态
目的
验证 RSVP 会话的状态。在每台交换机上执行此验证任务。
操作
user@switchPE-1> show rsvp session Ingress RSVP: 1 sessions To From State Rt Style Labelin Labelout LSPname 127.1.13 127.1.1.1 Up 0 1 FF - 300064 lsp_to_pe2_ge1 Total 1 displayed, Up 1, Down 0 Egress RSVP: 1 sessions To From State Rt Style Labelin Labelout LSPname 127.1.1.1 127.1.1.3 Up 0 1 FF 299968 lsp_to_pe1_ge1 Total 1 displayed, Up 1, Down 0 Transit RSVP: 0 sessions Total 0 displayed, Up 0, Down 0
意义
此输出确认 RSVP 会话为 Up。
验证 MPLS 标签操作的接口分配
目的
验证哪个接口用作 CCC 的开头,以及哪个接口用于将 MPLS 数据包推送到下一跃点。仅在 PE 交换机上执行此任务。
操作
user@switchPE-1> show route forwarding-table family mpls MPLS: Destination Type RtRef Next hop Type Index NhRef Netif default perm 0 dscd 50 1 0 user 0 recv 49 3 1 user 0 recv 49 3 2 user 0 recv 49 3 299776 user 0 Pop 541 2 ge-0/0/1.0 ge-0/0/1.0 (CCC) user 0 2.0.0.1 Push 299792 540 2 ge-0/0/5.0
意义
此输出显示已在接口 ge-0/0/1.0上设置 CCC。交换机接收入口 ge-0/0/1.0 流量并将标签 299792 推送到数据包上,数据包通过接口 ge-0/0/5.0传出。输出还显示,当交换机收到标签为 29976 的 MPLS 数据包时,它会弹出标签并通过接口将数据包发送出去 ge-0/0/1.0
检查本地 PE 交换机后,在远程 PE 交换机上运行相同的命令。
验证 CCC 的状态
目的
验证 CCC 的状态。仅在 PE 交换机上执行此任务。
操作
user@switchPE-1> 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 <- -- only inbound conn is up Legend for circuit types Up -- operational intf -- interface RmtDn -- remote CCC down tlsp -- transmit LSP Restart -- restarting rlsp -- receive LSP Connection/Circuit Type St Time last up # Up trans ge1-to-pe2 rmt-if Up Feb 17 05:00:09 1 ge-0/0/1.0 intf Up lsp_to_pe1_ge1 tlsp Up lsp_to_pe2_ge1 rlsp Up
意义
该 show connections
命令显示 CCC 连接的状态。此输出验证 CCC 接口及其关联的传输和接收 LSP 是否为 Up。检查本地 PE 交换机后,在远程 PE 交换机上运行相同的命令。