Example: Configuring Egress Protection for Layer 3 VPN Services
This example shows how to configure egress protection for fast restoration of Layer 3 VPN services.
Requirements
This example uses the following hardware and software components
- MX Series 3D Universal Edge Routers
- Tunnel PICs or the configuration of the Enhanced IP Network Services mode (using the network-services enhanced-ip statement at the [edit chassis] hierarchy level).
- Junos OS Release 11.4R3 or later running on the devices
Before you begin:
- Configure the device interfaces. See the Junos OS Network Interfaces Configuration Guide.
- Configure the following routing protocols on all the PE
and PLR routers.
- MPLS, LSPs, and LDP. See the Junos OS MPLS Applications Configuration Guide.
- BGP and IS-IS. See the Junos OS Routing Protocols Configuration Guide.
- Configure Layer 3 VPNs. See the Junos OS VPNs Configuration Guide.
Overview
Typically, Layer 3 VPN service restoration, in case of egress PE router failure (for multihomed customer edge [CE] routers), depends on the ingress PE router to detect the egress PE node failure and switch traffic to the backup PE router for multihomed CE sites.
Junos OS Release 11.4R3 or later enables you to configure egress protection for Layer 3 VPN services that protects the services from egress PE node failure in a scenario where the CE site is multihomed with more than one PE router. The mechanism enables local repair to be performed immediately upon an egress node failure. The router acting as the point of local repair (PLR) redirects VPN traffic to a protector PE router for restoring service quickly, achieving fast protection that is comparable to MPLS fast reroute.
The statements used to configure egress protection are:
- egress-protection—When configured at
the [edit protocols mpls] hierarchy level, this statement specifies
protector information and the context identifier for the Layer 3 VPN
and edge protection virtual circuit:[edit protocols mpls]egress-protection {context-identifier context-id {primary | protector;metric igp-metric-value;}}
When configured at the [edit protocols bgp group group-name family inet-vpn unicast], [edit protocols bgp group group-name family inet6-vpn unicast], or [edit protocols bgp group group-name family iso-vpn unicast] hierarchy levels, the egress-protection statement specifies the context identifier that enables egress protection for the configured BGP VPN network layer reachability information (NRLI).
[edit protocols bgp]group internal {type internal;local-address ip-address;family <inet-vpn|inet6-vpn|iso-vpn> {unicast {egress-protection {context-identifier {context-id-ip-address;}}}}}When configured at the [edit routing-instances] hierarchy level, the egress-protection statement holds the context identifier of the protected PE router.
This configuration must be done only in the primary PE router and is used for outbound BGP updates for the next hops.
[edit routing-instance]routing-instance-name {egress-protection {context-identifier {context-id-ip-address;}}}Configuring the context-identifier statement at the [edit routing-instances routing-instance-name] hierarchy level provides customer edge VRL-level context ID granularity for each VRF instance.
- context-identifier—This statement specifies an IPV4 address used to define the pair of PE routers participating in the egress protection LSP. The context identifier is used to assign an identifier to the protector PE router. The identifier is propagated to the other PE routers participating in the network, making it possible for the protected egress PE router to signal the egress protection LSP to the protector PE router.
Configuration
CLI Quick Configuration
![]() | Note: This example only shows sample configuration that is relevant to configuring egress PE protection for Layer 3 VPN services on the protected router, PE2, the protector router, PE3, and the PLR router. |
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.
PE2 (Protected PE Router)
PE3 (Protector PE Router)
PLR Router
Configuring the Protected PE Router (PE2)
Step-by-Step Procedure
To configure the protected PE router, PE2:
- Configure MPLS on the interfaces.[edit protocols mpls]user@PE2# set interface alluser@PE2#set interface fxp0.0 disable
- Configure egress protection and the context identifier.

Note: The context identifier type must be set to primary.
[edit protocols mpls]user@PE2# set egress-protection context-identifier 66.6.6.6 primary - Configure egress protection for the configured BGP NRLI.

Note: The context identifier configured at the [edit protocols bgp group group-name family inet-vpn] hierarchy level should match the context identifier configured at the [edit protocols mpls] hierarchy level.
[edit protocols bgp]user@PE2# set group ibgp type internaluser@PE2# set group ibgp local-address 10.255.245.194user@PE2# set group ibgp family inet-vpn unicast egress-protection context-identifier 66.6.6.6
Note: Configuring the context-identifier at the [edit routing-instances routing-instance-name] hierarchy level provides CE VRF-level context-id granularity for each virtual routing and forwarding (VRF) instance.
- After you are done configuring the device, commit the
configuration.[edit]user@PE2# commit
Results
Confirm your configuration by issuing the show protocols command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
Configuring the Protector PE Router (PE3)
Step-by-Step Procedure
To configure the protector PE router, PE3:
- Configure MPLS on the interfaces.[edit protocols mpls]user@PE3# set interface alluser@PE3#set mpls interface fxp0.0 disable
- Configure egress protection and the context identifier.[edit protocols mpls]user@PE3#set egress-protection context-identifier 66.6.6.6 protector
- Configure IPv4 Layer 3 VPN NRLI parameters.[edit protocols bgp]user@PE3# set group ibgp type internaluser@PE3# set group ibgp local-address 10.255.245.196user@PE3# set group ibgp family inet-vpn unicast egress-protection keep-import remote-vrf
- Configure routing policy options.[edit policy-options]user@PE3# set policy-statement remote-vrf from community rsite1user@PE3# set policy-statement remote-vrf from community rsite24user@PE3# set policy-statement remote-vrf then acceptuser@PE3# set community rsite1 members target:1:1user@PE3# set community rsite24 members target:100:1023
- After you are done configuring the device, commit the
configuration.[edit]user@PE3# commit
Results
Confirm your configuration by issuing the show protocols and the show policy-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
Configuring the PLR Router
Step-by-Step Procedure
To configure the router acting as the point of local repair (PLR):
- Configure MPLS on the interfaces.[edit protocols mpls]user@PLR# set interface alluser@PLR# set interface fxp0.0 disable
- Configure per-prefix-LFA calculation along with link protection.[edit protocols isis]user@PLR# set backup-spf-options per-prefix-calculationuser@PLR# set level 1 disableuser@PLR# set interface all node-link-protectionuser@PLR# set interface fxp0.0 disable
- Configure LDP to use the interior gateway protocol (IGP)
route metric instead of the default LDP route metric (the default
LDP route metric is 1).[edit protocols ldp]user@PLR# set track-igp-metricuser@PLR# set interface alluser@PLR# set interface fxp0.0 disable
Results
Confirm your configuration by issuing the show protocols command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
Verification
Confirm that the configuration is working properly.
Verifying Egress Protection Details
Purpose
Check the egress protection configuration.
Action
user@PE3> show mpls egress-protection detailsInstance Type Protection-Type rsite1 remote-vrf Protector RIB __66.6.6.6-rsite1__.inet.0, Context-Id 66.6.6.6, Enhanced-lookup Route Target 1:1 rsite24 remote-vrf Protector RIB __66.6.6.6-rsite24__.inet.0, Context-Id 66.6.6.6, Enhanced-lookup Route Target 100:1023
Meaning
Instance indicates the routing-instance name. Type shows the type of the VRF. It can be either local-vrf or remote-vrf. RIB (routing information base) indicates the edge-protection created routing table. Context-Id shows the context ID associated with the RIB. Route Target shows the route target associated with the routing instance.
Verifying Routing Instances
Purpose
Verify the routing instances.
Action
user@PE3> show route instance site1 detail
site1:
Router ID: 1.5.0.1
Type: vrf State: Active
Interfaces:
lt-1/3/0.8
Route-distinguisher: 10.255.255.11:150
Vrf-import: [ site1-import ]
Vrf-export: [ __vrf-export-site1-internal__ ]
Vrf-export-target: [ target:100:250 ]
Fast-reroute-priority: low
Vrf-edge-protection-id: 66.6.6.6
Tables:
site1.inet.0 : 27 routes (26 active, 0 holddown, 0 hidden)
site1.iso.0 : 0 routes (0 active, 0 holddown, 0 hidden)
site1.inet6.0 : 0 routes (0 active, 0 holddown, 0 hidden)
site1.mdt.0 : 0 routes (0 active, 0 holddown, 0 hidden)
Meaning
Vrf-edge-protection-id shows the egress protection configured in the protector PE router with the routing instance.
Verifying BGP NRLI
Purpose
Check the details of the BGP VPN network layer reachability information.
Action
user@PE3> show bgp neighborPeer: 10.255.55.1+179 AS 65535 Local: 10.255.22.1+59264 AS 65535 Type: Internal State: Established Flags: <ImportEval Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Options: <Preference LocalAddress KeepAll AddressFamily Rib-group Refresh> Address families configured: inet-vpn-unicast Local Address: 10.255.22.1 Holdtime: 90 Preference: 170 NLRI configured with egress-protection: inet-vpn-unicast Egress-protection NLRI inet-vpn-unicast, keep-import: [ VPN-A-remote ] Number of flaps: 0
Meaning
NLRI configured with egress-protection shows the BGP family configured with egress protection. egress-protection NLRI inet-vpn-unicast, keep-import: [remote-vrf] shows the egress protection routing policy for the BGP group.