帮助我们改善您的体验。

让我们了解您的想法。

您是否能抽出两分钟的时间完成一份问卷调查?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation

路由设备 2 层 VPN 和 VPLS 用户指南

keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
keyboard_arrow_right

机器翻译对您有帮助吗?

starstarstarstarstar
Go to English page
免责声明:

我们将使用第三方机器翻译软件翻译本页面。瞻博网络虽已做出相当大的努力提供高质量译文,但无法保证其准确性。如果对译文信息的准确性有任何疑问,请参阅英文版本. 可下载的 PDF 仅提供英文版.

示例:将第 2 层 VPN 与第 3 层 VPN 互连

date_range 16-Jun-23

此示例提供用于将第 2 层 VPN 与第 3 层 VPN 互连和验证的分步过程和命令。其中包含以下部分:

要求

此示例使用以下硬件和软件组件:

  • Junos OS 9.3 或更高版本

  • 五台 MX 系列路由器

  • 三个 M 系列路由器

  • 两个 T 系列路由器

概述和拓扑

第 2 层 VPN 是一种使用 MPLS 标签传输数据的虚拟专用网络 (VPN)。通信发生在提供商边缘 (PE) 路由器之间。

与第 2 层传统 VPN 相比,第 2 层 VPN 使用 BGP 作为信令协议,因此设计更简单,所需的配置开销更少。BGP 信令还支持自动发现第 2 层 VPN 对等方。第 2 层 VPN 可以采用全网状或中心辐射型拓扑。核心网络的隧道机制通常为 MPLS。但是,第 2 层 VPN 也可以使用其他隧道协议,如 GRE。

第 3 层 VPN 基于 RFC 2547bis、 BGP/MPLS IP VPN。RFC 2547bis 定义了一种机制,通过该机制,服务提供商可以使用其 IP 主干为客户提供 VPN 服务。第 3 层 VPN 是一组共享通用路由信息的站点,其连接由一组策略控制。构成第 3 层 VPN 的站点通过提供商现有的公共互联网主干网进行连接。RFC 2547bis VPN 也称为 BGP/MPLS VPN,因为 BGP 用于在提供商的主干网之间分配 VPN 路由信息,而 MPLS 用于通过主干网络将 VPN 流量转发到远程 VPN 站点。

客户网络由于是专用地址,因此可以使用公共地址或专用地址,如 RFC 1918“ 专用互联网地址分配”中的定义。当使用专用地址的客户网络连接到公共互联网基础架构时,专用地址可能会与其他网络用户使用的相同专用地址重叠。MPLS/BGP VPN 通过添加 路由识别器来解决此问题。路由识别符是从特定 VPN 站点添加到每个地址的 VPN 标识符前缀,从而在 VPN 和互联网中创建唯一的地址。

此外,每个 VPN 都有自己特定于 VPN 的路由表,仅包含该 VPN 的路由信息。为了将 VPN 的路由与公共互联网中的路由或其他 VPN 中的路由分离,PE 路由器会为每个 VPN 创建一个单独的路由表,称为 VPN 路由和转发 (VRF) 表。PE 路由器为每个连接到客户边缘 (CE) 路由器的 VPN 创建一个 VRF 表。属于 VPN 的任何客户或站点都只能访问该 VPN VRF 表中的路由。每个 VRF 表都有一个或多个与之关联的扩展社区属性,用于将路由标识为属于特定路由器集合。其中之一( 路由目标 属性)标识 PE 路由器分发路由的站点集合 (VRF 表)。PE 路由器使用路由目标来限制将远程路由导入其 VRF 表中。

当入口 PE 路由器收到从直连 CE 路由器播发的路由时,会对照该 VPN 的 VRF 导出策略检查收到的路由。

  • 如果匹配,则路由将转换为 VPN-IPv4 格式,即将路由识别器添加到路由中。然后,PE 路由器将 VPN-IPv4 格式的路由通告给远程 PE 路由器。它还将路由目标连接到从直连站点获得的每个路由。连接到路由的路由目标基于 VRF 表配置的导出目标策略的值。然后,这些路由将使用在提供商核心网络中配置的 IBGP 会话进行分发。

  • 如果来自 CE 路由器的路由不匹配,则不会将其导出到其他 PE 路由器,但它仍然可以在本地用于路由,例如,当同一 VPN 中的两台 CE 路由器直接连接到同一 PE 路由器时。

出口 PE 路由器收到路由时,会根据 PE 路由器之间的 IBGP 会话上的导入策略进行检查。如果接受,路由器将路由放入其 bgp.l3vpn.0 表中。同时,路由器会对照 VPN 的 VRF 导入策略检查路由。如果匹配,则路由识别器将从路由中移除,并将路由置于 IPv4 格式的 routing-instance-nameVRF 表(.inet.0 表)中。

拓扑

图 1 显示了第 2 层 VPN 到第 3 层 VPN 互连的物理拓扑。

图 1:终止为第 3 层 VPN 的第 2 层 VPN Physical Topology of a Layer 2 VPN Terminating into a Layer 3 VPN 的物理拓扑

第 2 层 VPN 到第 3 层 VPN 互连的逻辑拓扑如图 2 所示。

图 2:终止为第 3 层 VPN 的第 2 层 VPN Logical Topology of a Layer 2 VPN Terminating into a Layer 3 VPN 的逻辑拓扑

以下定义描述了 图 1 和图 2 中使用的设备缩写的含义。

  • 客户边缘 (CE) 设备 — 客户本地的一台设备,通过数据链路连接到一个或多个提供商边缘 (PE) 路由器,提供对服务提供商 VPN 的访问。

    通常,CE 设备是与其直连 PE 路由器建立邻接的 IP 路由器。建立邻接后,CE 路由器将站点的本地 VPN 路由播发至 PE 路由器,并从 PE 路由器学习远程 VPN 路由。

  • 提供商边缘 (PE) 设备 — 位于提供商网络边缘的一台设备或一组设备,可显示提供商的客户站点视图。

    PE 路由器与 CE 路由器交换路由信息。PE 路由器可以识别通过 VPN 连接的 VPN,而 PE 路由器会维护 VPN 状态。只有 PE 路由器才能为其直连的 VPN 维护 VPN 路由。从 CE 路由器学习本地 VPN 路由后,PE 路由器使用 IBGP 与其他 PE 路由器交换 VPN 路由信息。最后,在使用 MPLS 跨提供商的主干网转发 VPN 数据流量时,入口 PE 路由器充当入口标签交换路由器 (LSR),出口 PE 路由器用作出口 LSR。

  • 提供商 (P) 设备 — 一种在提供商核心网络中运行且不直接连接到任何 CE 的设备。

    虽然 P 设备是为服务提供商的客户实施 VPN 的关键部分,并且可能为属于不同 VPN 的许多提供商运营的隧道提供路由,但它本身并不具有 VPN 感知能力,并且不维护 VPN 状态。它的主要作用是允许服务提供商扩展其 VPN 产品,例如,充当多个 PE 路由器的聚合点。

    在 PE 路由器之间转发 VPN 数据流量时,P 路由器可充当 MPLS 传输 LSR。P 路由器仅用于维护到提供商 PE 路由器的路由;他们不需要维护每个客户站点的特定 VPN 路由信息。

配置

要将第 2 层 VPN 与第 3 层 VPN 互连,请执行以下操作:

配置基本协议和接口

逐步过程

  1. 在每个 PE 和 P 路由器上,在所有接口上配置具有流量工程扩展的 OSPF。禁用 fxp0.0 接口上的 OSPF。

    content_copy zoom_out_map
    [edit protocols]
    ospf {
        traffic-engineering;
        area 0.0.0.0 {
            interface all;
            interface fxp0.0 {
                disable;
            }
        }
    }
    
  2. 在所有核心路由器上,在所有接口上启用 MPLS。禁用 fxp0.0 接口上的 MPLS。

    content_copy zoom_out_map
    [edit protocols]
    mpls {
        interface all;
        interface fxp0.0 {
            disable;
        }
    }
    
  3. 在所有核心路由器上,创建一个内部 BGP 对等组,并将路由反射器地址 (192.0.2.7) 指定为邻接方。此外,通过在层次结构级别包含 signaling 语句 [edit protocols bgp group group-name family l2vpn] ,使 BGP 能够为此对等组传输第 2 层 VPLS 网络层可访问性信息 (NLRI) 消息。

    content_copy zoom_out_map
    [edit protocols]
    bgp {
        group RR {
            type internal;
            local-address 192.0.2.2;
            family l2vpn {
                signaling;
            }
            neighbor 192.0.2.7;
        }
    }
    
  4. 在路由器 PE3 上,创建内部 BGP 对等组,并将路由反射器 IP 地址 (192.0.2.7) 指定为邻接方。启用 BGP 以为此对等组传输第 2 层 VPLS NLRI 消息,并通过在[edit protocols bgp group group-name family inet-vpn]层次结构级别包含unicast语句来处理 VPN-IPv4 地址。

    content_copy zoom_out_map
    [edit protocols]
    bgp {
        group RR {
            type internal;
            local-address 192.0.2.3;
            family inet-vpn {
                unicast;
            }
            family l2vpn {
                signaling;
            }
            neighbor 192.0.2.7;
        }
    }
    
  5. 对于路由器 PE3 和路由器 PE5 上的第 3 层 VPN 域,请在所有接口上启用 RSVP。禁用 fxp0.0 接口上的 RSVP。

    content_copy zoom_out_map
    [edit protocols]
    rsvp {
        interface all;
        interface fxp0.0 {
            disable;
        }
    }
    
  6. 在路由器 PE3 和路由器 PE5 上,创建到路由反射器和其他 PE 路由器的标签交换路径 (LSP)。以下示例显示了路由器 PE5 上的配置。

    content_copy zoom_out_map
    [edit protocols]
    mpls {
        label-switched-path to-RR {
            to 192.0.2.7;
        }
        label-switched-path to-PE2 {
            to 192.0.2.2;
        }
        label-switched-path to-PE3 {
            to 192.0.2.3;
        }
        label-switched-path to-PE4 {
            to 192.0.2.4;
        }
        label-switched-path to-PE1 {
            to 192.0.2.1;
        }
    }
    
  7. 在路由器 PE1、PE2、PE3 和 PE5 上,使用 IPv4 地址配置核心接口并启用 MPLS 地址系列。以下示例显示了路由器 PE2 上的 xe-0/1/0 接口的配置。

    content_copy zoom_out_map
    [edit]
    interfaces {
        xe-0/1/0 {
            unit 0 {
                family inet {
                    address 10.10.2.2/30;
                }
                family mpls;
            }
        }
    }
    
  8. 在路由器 PE2 和路由器 PE3 上,为所有接口的第 2 层 VPN MPLS 信令协议配置 LDP。禁用 fxp0.0 接口上的 LDP。(也可使用 RSVP。)

    content_copy zoom_out_map
    [edit protocols]
    ldp {
        interface all;
        interface fxp0.0 {
            disable;
        }
    }
    
  9. 在路由反射器上,创建内部 BGP 对等组,并将 PE 路由器的 IP 地址指定为邻接方。

    content_copy zoom_out_map
    [edit]
    protocols {
        bgp {
            group RR {
                type internal;
                local-address 192.0.2.7;
                family inet {
                    unicast;
                }
                family inet-vpn {
                    unicast;
                }
                family l2vpn {
                    signaling;
                }
                cluster 192.0.2.7;
                neighbor 192.0.2.1;
                neighbor 192.0.2.2;
                neighbor 192.0.2.4;
                neighbor 192.0.2.5;
                neighbor 192.0.2.3;
            }
        }
    }
    
  10. 在路由反射器上,将 MPLS LSP 配置为路由器 PE3 和 PE5,以解决 inet.3 路由表中的 BGP 下一跃点。

    content_copy zoom_out_map
    [edit]
    protocols {
        mpls {
            label-switched-path to-pe3 {
                to 192.0.2.3;
            }
            
            label-switched-path to-pe5 {
                to 192.0.2.5;
            }
            interface all;
        }
    }
    

配置 VPN 接口

逐步过程

路由器 PE2 是 2 层 VPN 的一端。路由器 PE3 在第 2 层 VPN 和第 3 层 VPN 之间执行第 2 层 VPN 拼接。路由器 PE3 使用在两个不同的第 2 层 VPN 实例下应用了不同逻辑接口单元配置的逻辑隧道接口(lt 接口)。数据包通过路由器 PE3 上配置的 lt 接口实现环路。路由器 PE5 的配置包含 PE-CE 接口。

  1. 在路由器 PE2 上,配置 ge-1/0/2 接口封装。包括封装语句并指定 ethernet-ccc 层级的选项(vlan-ccc 也支持 [edit interfaces ge-1/0/2] 封装)。整个第 2 层 VPN 域(路由器 PE2 和 PE3)的封装应相同。此外,配置接口 lo0。

    content_copy zoom_out_map
    [edit]
    interfaces {
        ge-1/0/2 {
            encapsulation ethernet-ccc;
            unit 0;
        }
        lo0 {
            unit 0 {
                family inet {
                    address 192.0.2.2/24;
                }
            }
        }
    }
    
  2. 在路由器 PE2 上,在 [edit routing-instances] 层次结构级别配置路由实例。此外,在 [edit routing-instances routing-instances-name protocols] 层次结构级别配置第 2 层 VPN 协议。将远程站点 ID 配置为 3。站点 ID 3 表示路由器 PE3 (Hub-PE)。第 2 层 VPN 使用 LDP 作为信令协议。请注意,在以下示例中,路由实例和协议均被命名 l2vpn

    content_copy zoom_out_map
    [edit]
    routing-instances {
        l2vpn { # routing instance
            instance-type l2vpn;
            interface ge-1/0/2.0;
            route-distinguisher 65000:2;
            vrf-target target:65000:2;
            protocols {
                l2vpn { # protocol
                    encapsulation-type ethernet;
                    site CE2 {
                        site-identifier 2;
                        interface ge-1/0/2.0 {
                            remote-site-id 3;
                        }
                    }
                }
            }
        }
    }
    
  3. 在路由器 PE5 上,为 PE-CE 链路 ge-2/0/0 配置千兆以太网接口,然后配置 lo0 接口。

    content_copy zoom_out_map
    [edit interfaces]
    ge-2/0/0 {
        unit 0 {
            family inet {
                address 198.51.100.8/24;
            }
        }
    }
    lo0 {
        unit 0 {
        }
    }
    
  4. 在路由器 PE5 上,配置层级的第 3 层 VPN 路由实例 (L3VPN)。 [edit routing-instances] 还要在 [edit routing-instances L3VPN protocols] 层次结构级别配置 BGP。

    content_copy zoom_out_map
    [edit]
    routing-instances {
        L3VPN {
            instance-type vrf;
            interface ge-2/0/0.0;
            route-distinguisher 65000:5;
            vrf-target target:65000:2;
            vrf-table-label;
            protocols {
                bgp {
                    group ce5 {
                        neighbor 198.51.100.2 {
                            peer-as 200;
                        }
                    }
                }
            }
        }
    }
    
  5. 在 MX 系列路由器(如路由器 PE3)中,必须创建要用于隧道服务的隧道服务接口。要创建隧道服务接口,请包括 bandwidth 语句并指定在层次结构级别为隧道服务保留的带宽量(以千兆位/秒 [edit chassis fpc slot-number pic slot-number tunnel-services] )。

    content_copy zoom_out_map
    [edit]
    chassis {
        dump-on-panic;
        fpc 1 {
            pic 1 {
                tunnel-services {
                    bandwidth 1g;
                }
            }
        }
    }
    
  6. 在路由器 PE3 上,配置千兆以太网接口。

    address 层次结构级别包括语句 [edit interfaces ge-1/0/1.0 family inet] 并指定 198.51.100.9/24 为 IP 地址。

    content_copy zoom_out_map
    [edit]
    interfaces {
        ge-1/0/1 {
            unit 0 {
                family inet {
                    address 198.51.100.9/24;
                }
            }
        }
    }
    
  7. 在路由器 PE3 上,配置 lt-1/1/10.0 层级的 [edit interfaces lt-1/1/10 unit 0] 逻辑隧道接口。路由器 PE3 是使用逻辑隧道 接口将第 2 层 VPN 拼接到第 3 层 VPN 的路由器。对等单元接口的配置是互连的组成。

    要配置接口,请添加 encapsulation 语句并指定 ethernet-ccc 选项。包括语句 peer-unit 并将逻辑接口单元 1 指定为对等隧道接口。包括语句 family 并指定 ccc 选项。

    content_copy zoom_out_map
    [edit]
    interfaces {
        lt-1/1/10 {
            unit 0 {
                encapsulation ethernet-ccc;
                peer-unit 1;
                family ccc;
            }
        }
    }
    
  8. 在路由器 PE3 上,配置 lt-1/1/10.1 层级的 [edit interfaces lt-1/1/10 unit 1] 逻辑隧道接口。

    要配置接口,请添加 encapsulation 语句并指定 ethernet 选项。包括语句 peer-unit 并将逻辑接口单元 0 指定为对等隧道接口。包括语句 family 并指定 inet 选项。在 address 层次结构级别包括语句 [edit interfaces lt-1/1/10 unit 0] ,并指定 198.51.100.7/24 为 IPv4 地址。

    content_copy zoom_out_map
    [edit]
    interfaces {
        lt-1/1/10 {
            unit 1 {
                encapsulation ethernet;
                peer-unit 0;
                family inet {
                    address 198.51.100.7/24;
                }
            }
        }
    }
    
  9. 在路由器 PE3 上,将lt接口单元 1 添加到层次结构级别的路由实例[edit routing-instances L3VPN]。将实例类型vrflt配置为对等单元 1 作为 PE-CE 接口,以将路由器 PE2 上的第 2 层 VPN 终止到路由器 PE3 上的第 3 层 VPN。

    content_copy zoom_out_map
    [edit]
    routing-instances {
        L3VPN {
            instance-type vrf;
            interface ge-1/0/1.0;
            interface lt-1/1/10.1;
            route-distinguisher 65000:33;
            vrf-target target:65000:2;
            vrf-table-label;
            protocols {
                bgp {
                    export direct;
                    group ce3 {
                        neighbor 198.51.100.10 {
                            peer-as 100;
                        }
                    }
                }
            }
        }
    }
    
  10. 在路由器 PE3 上,将 lt 接口单元 0 添加到层级的 [edit routing-instances protocols l2vpn] 路由实例中。还要为第 2 层 VPN 和第 3 层 VPN 路由实例配置相同的 vrf 目标,以便在实例之间发生路由泄漏。上一步中的配置示例显示了路由实例的 L3VPN vrf 目标。以下示例显示了路由实例的 l2vpn vrf 目标。

    content_copy zoom_out_map
    [edit]
    routing-instances {
        l2vpn {
            instance-type l2vpn;
            interface lt-1/1/10.0;
            route-distinguisher 65000:3;
            vrf-target target:65000:2;
            protocols {
                l2vpn {
                    encapsulation-type ethernet;
                    site CE3 {
                        site-identifier 3;
                        interface lt-1/1/10.0 {
                            remote-site-id 2;
                        }
                    }
                }
            }
        }
    }
    
  11. 在路由器 PE3 上,配置语句 policy-statement ,以便在需要时从直连 lt 接口单元 1 中学习到所有 CE 路由器进行连接。

    content_copy zoom_out_map
    [edit]
    policy-options {
        policy-statement direct {
            term 1 {
                from protocol direct;
                then accept;
            }
        }
    }
    

结果

以下输出显示路由器 PE2 的完整配置:

路由器 PE2

content_copy zoom_out_map
interfaces {
    xe-0/1/0 {
        unit 0 {
            family inet {
                address 10.10.2.2/30;
            }
            family mpls;
        }
    }
    xe-0/2/0 {
        unit 0 {
            family inet {
                address 10.10.5.1/30;
            }
            family mpls;
        }
    }
    xe-0/3/0 {
        unit 0 {
            family inet {
                address 10.10.4.1/30;
            }
            family mpls;
        }
    }
    ge-1/0/2 {
        encapsulation ethernet-ccc;
        unit 0;
    }
    fxp0 {
        apply-groups [ re0 re1 ];
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.0.2.2/24;
            }
        }
    }
}
routing-options {
    static {
        route 172.0.0.0/8 next-hop 172.19.59.1;
    }
    autonomous-system 65000;
}
protocols {
    mpls {
        interface all;
        interface fxp0.0 {
            disable;
        }
    }
    bgp {
        group RR {
            type internal;
            local-address 192.0.2.2;
            family l2vpn {
                signaling;
            }
            neighbor 192.0.2.7;
        }
    }
    ospf {
        traffic-engineering;
        area 0.0.0.0 {
            interface all;
            interface fxp0.0 {
                disable;
            }
        }
    }
    ldp {
        interface all;
        interface fxp0.0 {
            disable;
        }
    }
}
routing-instances {
    l2vpn {
        instance-type l2vpn;
        interface ge-1/0/2.0;
        route-distinguisher 65000:2;
        vrf-target target:65000:2;
        protocols {
            l2vpn {
                encapsulation-type ethernet;
                site CE2 {
                    site-identifier 2;
                    interface ge-1/0/2.0 {
                        remote-site-id 3;
                    }
                }
            }
        }
    }
}

以下输出显示路由器 PE5 的最终配置:

路由器 PE5

content_copy zoom_out_map
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.10.4.2/30;
            }
            family mpls;
        }
    }
    xe-0/1/0 {
        unit 0 {
            family inet {
                address 10.10.6.2/30;
            }
            family mpls;
        }
    }
    ge-1/0/0 {
        unit 0 {
            family inet {
                address 10.10.9.1/30;
            }
            family mpls;
        }
    }
    xe-1/1/0 {
        unit 0 {
            family inet {
                address 10.10.3.2/30;
            }
            family mpls;
        }
    }
    ge-2/0/0 {
        unit 0 {
            family inet {
                address 198.51.100.8/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.0.2.5/24;
            }
        }
    }
}
routing-options {
    static {
        route 172.0.0.0/8 next-hop 172.19.59.1;
    }
    autonomous-system 65000;
}
protocols {
    rsvp {
        interface all {
            link-protection;
        }
        interface fxp0.0 {
            disable;
        }
    }
    mpls {
        label-switched-path to-RR {
            to 192.0.2.7;
        }
        label-switched-path to-PE2 {
            to 192.0.2.2;
        }
        label-switched-path to-PE3 {
            to 192.0.2.3;
        }
        label-switched-path to-PE4 {
            to 192.0.2.4;
        }
        label-switched-path to-PE1 {
            to 192.0.2.1;
        }
        interface all;
        interface fxp0.0 {
            disable;
        }
        
    }
    bgp {
        group to-rr {
            type internal;
            local-address 192.0.2.5;
            family inet-vpn {
                unicast;
            }
            family l2vpn {
                signaling;
            }
            neighbor 192.0.2.7;
        }
    }
    ospf {
        traffic-engineering;
        area 0.0.0.0 {
            interface all;
            interface fxp0.0 {
                disable;
            }
        }
    }
    ldp {
        interface all;
        interface fxp0.0 {
            disable;
        }
    }
}
routing-instances {
    L3VPN {
        instance-type vrf;
        interface ge-2/0/0.0;
        route-distinguisher 65000:5;
        vrf-target target:65000:2;
        vrf-table-label;
        protocols {
            bgp {
                group ce5 {
                    neighbor 198.51.100.2 {
                        peer-as 200;
                    }
                }
            }
        }
    }
}

以下输出显示路由器 PE3 的最终配置:

路由器 PE3

content_copy zoom_out_map
chassis {
    dump-on-panic;
    fpc 1 {
        pic 1 {
            tunnel-services {
                bandwidth 1g;
            }
        }
    }
    network-services ip;
}
interfaces {
    ge-1/0/1 {
        unit 0 {
            family inet {
                address 198.51.100.9/24;
            }
        }
    }
    lt-1/1/10 {
        unit 0 {
            encapsulation ethernet-ccc;
            peer-unit 1;
            family ccc;
        }
        unit 1 {
            encapsulation ethernet;
            peer-unit 0;
            family inet {
                address 198.51.100.7/24;
            }
        }
    }
    xe-2/0/0 {
        unit 0 {
            family inet {
                address 10.10.20.2/30;
            }
            family mpls;
        }
    }
    xe-2/1/0 {
        unit 0 {
            family inet {
                address 10.10.6.1/30;
            }
            family mpls;
        }
    }
    xe-2/2/0 {
        unit 0 {
            family inet {
                address 10.10.5.2/30;
            }
            family mpls;
        }
    }
    xe-2/3/0 {
        unit 0 {
            family inet {
                address 10.10.1.2/30;
            }
            family mpls;
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 192.0.2.3/24;
            }
        }
    }
}
routing-options {
    static {
        route 172.0.0.0/8 next-hop 172.19.59.1;
    }
    autonomous-system 65000;
}
protocols {
    rsvp {
        interface all;
        interface fxp0.0 {
            disable;
        }
    }
    mpls {
        label-switched-path to-RR {
            to 192.0.2.7;
        }
        label-switched-path to-PE2 {
            to 192.0.2.2;
        }
        label-switched-path to-PE5 {
            to 192.0.2.5;
        }
        label-switched-path to-PE4 {
            to 192.0.2.4;
        }
        label-switched-path to-PE1 {
            to 192.0.2.1;
        }
        interface all;
        interface fxp0.0 {
            disable;
        }
    }
    bgp {
        group RR {
            type internal;
            local-address 192.0.2.3;
            family inet-vpn {
                unicast;
            }
            family l2vpn {
                signaling;
            }
            neighbor 192.0.2.7;
        }
    }
    ospf {
        traffic-engineering;
        area 0.0.0.0 {
            interface all;
            interface fxp0.0 {
                disable;
            }
        }
    }
    ldp {
        interface all;
        interface fxp0.0 {
            disable;
        }
    }
}
policy-options {
    policy-statement direct {
        term 1 {
            from protocol direct;
            then accept;
        }
    }
}
routing-instances {
    L3VPN {
        instance-type vrf;
        interface ge-1/0/1.0;
        interface lt-1/1/10.1;
        route-distinguisher 65000:33;
        vrf-target target:65000:2;
        vrf-table-label;
        protocols {
            bgp {
                export direct;
                group ce3 {
                    neighbor 198.51.100.10 {
                        peer-as 100;
                    }
                }
            }
        }
    }
    l2vpn {
        instance-type l2vpn;
        interface lt-1/1/10.0;
        route-distinguisher 65000:3;
        vrf-target target:65000:2;
        protocols {
            l2vpn {
                encapsulation-type ethernet;
                site CE3 {
                    site-identifier 3;
                    interface lt-1/1/10.0 {
                        remote-site-id 2;
                    }
                }
            }
        }
    }
}

验证

验证第 2 层 VPN 到第 3 层 VPN 互连:

验证路由器 PE2 VPN 接口

目的

检查第 2 层 VPN 是否在路由器 PE2 接口上正常运行,以及所有路由都已存在。

行动

  1. show l2vpn connections使用命令验证路由器 PE3 的连接站点 ID 是否为 3,以及状态是否为Up

    content_copy zoom_out_map
    user@PE2> show l2vpn connections
    Layer-2 VPN connections:
    Legend for connection status (St)   
    EI -- encapsulation invalid      NC -- interface encapsulation not CCC/TCC/VPLS
    EM -- encapsulation mismatch     WE -- interface and instance encaps not same
    VC-Dn -- Virtual circuit down    NP -- interface hardware not present 
    CM -- control-word mismatch      -> -- only outbound connection is up
    CN -- circuit not provisioned    <- -- only inbound connection is up
    OR -- out of range               Up -- operational
    OL -- no outgoing label          Dn -- down                      
    LD -- local site signaled down   CF -- call admission control failure
    RD -- remote site signaled down  SC -- local and remote site ID collision
    LN -- local site not designated  LM -- local site ID not minimum designated
    RN -- remote site not designated RM -- remote site ID not minimum designated
    XX -- unknown connection status  IL -- no incoming label
    MM -- MTU mismatch               MI -- Mesh-Group ID not available
    BK -- Backup connection          ST -- Standby connection
    PF -- Profile parse failure      PB -- Profile busy
    RS -- remote site standby
    
    Legend for interface status 
    Up -- operational           
    Dn -- down
    
    Instance: l2vpn
      Local site: CE2 (2)
        connection-site     Type  St     Time last up        # Up trans
        3                   rmt   Up     Jan  7 14:14:37 2010         1
          Remote PE: 192.0.2.3, Negotiated control-word: Yes (Null)
          Incoming label: 800000, Outgoing label: 800001
          Local interface: ge-1/0/2.0, Status: Up, Encapsulation: ETHERNET
    
  2. show route table使用命令验证第 2 层 VPN 路由是否存在,以及接口是否有下一跃点10.10.5.2xe-0/2/0.0。以下输出用于验证 L2vpn.l2vpn.0 表中是否存在第 2 层 VPN 路由。路由器 PE3 应显示类似的输出。

    content_copy zoom_out_map
    user@PE2> show route table l2vpn.l2vpn.0
    l2vpn.l2vpn.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    65000:2:2:3/96                
                       *[L2VPN/170/-101] 02:40:35, metric2 1
                          Indirect
    65000:3:3:1/96                
                       *[BGP/170] 02:40:35, localpref 100, from 192.0.2.7
                          AS path: I
                        > to 10.10.5.2 via xe-0/2/0.0
    
  3. 验证路由器 PE2 有一个第 2 层 VPN MPLS 标签指向 LDP 标签到路由器 PE3 的两个方向(PUSH 和 POP)。

    content_copy zoom_out_map
    user@PE2> show route table mpls.0
     mpls.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    0                  *[MPLS/0] 1w3d 08:57:41, metric 1
                          Receive
    1                  *[MPLS/0] 1w3d 08:57:41, metric 1
                          Receive
    2                  *[MPLS/0] 1w3d 08:57:41, metric 1
                          Receive
    300560             *[LDP/9] 19:45:53, metric 1
                        > to 10.10.2.1 via xe-0/1/0.0, Pop      
    300560(S=0)        *[LDP/9] 19:45:53, metric 1
                        > to 10.10.2.1 via xe-0/1/0.0, Pop      
    301008             *[LDP/9] 19:45:53, metric 1
                        > to 10.10.4.2 via xe-0/3/0.0, Swap 299856
    301536             *[LDP/9] 19:45:53, metric 1
                        > to 10.10.4.2 via xe-0/3/0.0, Pop      
    301536(S=0)        *[LDP/9] 19:45:53, metric 1
                        > to 10.10.4.2 via xe-0/3/0.0, Pop      
    301712             *[LDP/9] 16:14:52, metric 1
                        > to 10.10.5.2 via xe-0/2/0.0, Swap 315184
    301728             *[LDP/9] 16:14:52, metric 1
                        > to 10.10.5.2 via xe-0/2/0.0, Pop      
    301728(S=0)        *[LDP/9] 16:14:52, metric 1
                        > to 10.10.5.2 via xe-0/2/0.0, Pop      
    800000             *[L2VPN/7] 02:40:35
                        > via ge-1/0/2.0, Pop       Offset: 4
    ge-1/0/2.0         *[L2VPN/7] 02:40:35, metric2 1
                        > to 10.10.5.2 via xe-0/2/0.0, Push 800001 Offset: -4
    

意义

接口l2vpnge-1/0/2上已启动路由实例,第 2 层 VPN 路由如表 l2vpn.l2vpn.0 中所示。表mpls.0显示了用于使用 LDP 标签转发流量的第 2 层 VPN 路由。

验证路由器 PE3 VPN 接口

目的

检查路由器 PE2 和路由器 PE3 的第 2 层 VPN 连接是否正常运行 Up

行动

  1. 验证是否已建立与家族 l2vpn-signaling 和家族 inet-vpn 的路由反射器的 BGP 会话。

    content_copy zoom_out_map
    user@PE3> show bgp summary
    Groups: 2 Peers: 2 Down peers: 0
    Table        Tot Paths  Act Paths Suppressed    History Damp State    Pending
    bgp.l2vpn.0          1          1          0          0          0          0
    bgp.L3VPN.0          1          1          0          0          0          0
    Peer        AS   InPkt    OutPkt   OutQ   Flaps Last Up/Dwn   State|#Active /Received/Accepted/Damped...
    192.0.2.7  65000    2063      2084      0       1    15:35:16   Establ
      bgp.l2vpn.0: 1/1/1/0
      bgp.L3VPN.0: 1/1/1/0
      L3VPN.inet.0: 1/1/1/0
      l2vpn.l2vpn.0: 1/1/1/0
    
  2. 以下输出将验证第 2 层 VPN 路由及其关联的标签。

    content_copy zoom_out_map
    user@PE3> show route table l2vpn.l2vpn.0 detail
    l2vpn.l2vpn.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
    65000:2:2:3/96 (1 entry, 1 announced)
            *BGP    Preference: 170/-101
                    Route Distinguisher: 65000:2
                    Next hop type: Indirect
                    Next-hop reference count: 4
                    Source: 192.0.2.7
                    Protocol next hop: 192.0.2.2
                    Indirect next hop: 2 no-forward
                    State: <Secondary Active Int Ext>
                    Local AS: 65000 Peer AS: 65000
                    Age: 2:45:52    Metric2: 1
                    Task: BGP_65000.192.0.2.7+60585
                    Announcement bits (1): 0-l2vpn-l2vpn
                    AS path: I (Originator) Cluster list:  192.0.2.7
                    AS path:  Originator ID: 192.0.2.2
                    Communities: target:65000:2 Layer2-info: encaps:ETHERNET, control flags:Control-Word, mtu: 0, site preference: 100  Accepted
                    Label-base: 800000, range: 2, status-vector: 0x0
                    Localpref: 100
                    Router ID: 192.0.2.7
                    Primary Routing Table bgp.l2vpn.0 
  3. 以下输出显示 mpls.0 路由表中的 L2VPN MPLS.0 路由。

    content_copy zoom_out_map
    user@PE3> show route table mpls.0
    mpls.0: 21 destinations, 21 routes (21 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    0                  *[MPLS/0] 1w3d 09:05:41, metric 1
                          Receive
    1                  *[MPLS/0] 1w3d 09:05:41, metric 1
                          Receive
    2                  *[MPLS/0] 1w3d 09:05:41, metric 1
                          Receive
    16                 *[VPN/0] 15:59:24
                          to table L3VPN.inet.0, Pop      
    315184             *[LDP/9] 16:21:53, metric 1
                        > to 10.10.20.1 via xe-2/0/0.0, Pop      
    315184(S=0)        *[LDP/9] 16:21:53, metric 1
                        > to 10.10.20.1 via xe-2/0/0.0, Pop      
    315200             *[LDP/9] 01:13:44, metric 1
                          to 10.10.20.1 via xe-2/0/0.0, Swap 625297
                        > to 10.10.6.2 via xe-2/1/0.0, Swap 299856
    315216             *[LDP/9] 16:21:53, metric 1
                        > to 10.10.6.2 via xe-2/1/0.0, Pop      
    315216(S=0)        *[LDP/9] 16:21:53, metric 1
                        > to 10.10.6.2 via xe-2/1/0.0, Pop      
    315232             *[LDP/9] 16:21:45, metric 1
                        > to 10.10.1.1 via xe-2/3/0.0, Pop      
    315232(S=0)        *[LDP/9] 16:21:45, metric 1
                        > to 10.10.1.1 via xe-2/3/0.0, Pop      
    315248             *[LDP/9] 16:21:53, metric 1
                        > to 10.10.5.1 via xe-2/2/0.0, Pop      
    315248(S=0)        *[LDP/9] 16:21:53, metric 1
                        > to 10.10.5.1 via xe-2/2/0.0, Pop      
    315312             *[RSVP/7] 15:02:40, metric 1
                        > to 10.10.6.2 via xe-2/1/0.0, label-switched-path to-pe5
    315312(S=0)        *[RSVP/7] 15:02:40, metric 1
                        > to 10.10.6.2 via xe-2/1/0.0, label-switched-path to-pe5
    315328             *[RSVP/7] 15:02:40, metric 1
                        > to 10.10.20.1 via xe-2/0/0.0, label-switched-path to-RR
    315360             *[RSVP/7] 15:02:40, metric 1
                        > to 10.10.20.1 via xe-2/0/0.0, label-switched-path to-RR
    316272             *[RSVP/7] 01:13:27, metric 1
                        > to 10.10.6.2 via xe-2/1/0.0, label-switched-path Bypass->10.10.9.1
    316272(S=0)        *[RSVP/7] 01:13:27, metric 1
                        > to 10.10.6.2 via xe-2/1/0.0, label-switched-path Bypass->10.10.9.1
    800001             *[L2VPN/7] 02:47:33
                        > via lt-1/1/10.0, Pop       Offset: 4
    lt-1/1/10.0        *[L2VPN/7] 02:47:33, metric2 1
                        > to 10.10.5.1 via xe-2/2/0.0, Push 800000 Offset: -4
    
  4. show route table mpls.0 命令与选项一起 detail 用于查看路由的 BGP 属性,例如下一跃点类型和标签操作。

    content_copy zoom_out_map
    user@PE5> show route table mpls.0 detail
    lt-1/1/10.0 (1 entry, 1 announced)
            *L2VPN  Preference: 7
                    Next hop type: Indirect
                    Next-hop reference count: 2
                    Next hop type: Router, Next hop index: 607
                    Next hop: 10.10.5.1 via xe-2/2/0.0, selected
                    Label operation: Push 800000 Offset: -4
                    Protocol next hop: 192.0.2.2
                    Push 800000 Offset: -4
                    Indirect next hop: 8cae0a0 1048574
                    State:  <Active Int>
                    Age: 2:46:34    Metric2: 1
                    Task: Common L2 VC
                    Announcement bits (2): 0-KRT 2-Common L2 VC
                    AS path: I
                    Communities: target:65000:2 Layer2-info: encaps:ETHERNET, control flags:Control-Word, mtu: 0, site preference: 100

验证从路由器 CE2 到路由器 CE5 和路由器 CE3 的端到端连接

目的

检查路由器 CE2、CE3 和 CE5 之间的连接。

行动

  1. 从路由器 CE2 对路由器 CE3 IP 地址执行 Ping 操作。

    content_copy zoom_out_map
    user@CE2> ping 198.51.100.10 # CE3 IP address
    PING 198.51.100.10 (198.51.100.10): 56 data bytes
    64 bytes from 198.51.100.10: icmp_seq=0 ttl=63 time=0.708 ms
    64 bytes from 198.51.100.10: icmp_seq=1 ttl=63 time=0.610 ms
    
  2. 从路由器 CE2 中对路由器 CE5 IP 地址执行 Ping 操作。

    content_copy zoom_out_map
    user@CE2> ping 198.51.100.2 # CE5 IP address
    PING 198.51.100.2 (198.51.100.2): 56 data bytes
    64 bytes from 198.51.100.2: icmp_seq=0 ttl=62 time=0.995 ms
    64 bytes from 198.51.100.2: icmp_seq=1 ttl=62 time=1.005 ms
    
footer-navigation