Configuring a Routing Policy for MPLS Layer 2 VPNs (CLI Procedure)
These instructions show how to configure a Layer 2 VPN routing policy on the PE routers in the VPN.
After configuring an import routing policy for a Layer 2 VPN, configure an export routing policy for the Layer 2 VPN. Configure this export policy on the PE routers in the VPN. The export routing policy defines how routes are exported from the PE router routing table. An export policy is applied to routes sent to other PE routers in the VPN. The export policy must also evaluate all routes received over the routing protocol session with the CE router. The export policy must also contain a second term for rejecting all other routes.
To configure a Layer 2 VPN routing policy on a PE router:
- Configure the import routing policy. [edit] user@host# edit policy-options policy-statement import-policy-name
- Define the import policy’s term for accepting packets.[edit edit policy-options policy-statement import-policy-name]user@host# set term term-name-accept from protocol bgp community community-nameuser@host# set term term-name-accept then accept
- Define the import policy’s term for rejecting packets.[edit edit policy-options policy-statement import-policy-name]user@host# set term term-name-reject then reject
- Configure the export routing policy.[edit] user@host# edit policy-options policy-statement export-policy-name
- Define the export policy’s term for accepting packets. [edit policy-options policy-statement export-policy-name]user@host# set term term-name-accept from community add community-nameuser@host# set termterm-name-accept then accept
- Define the export policy’s term for rejecting packets.[edit policy-options policy-statement export-policy-name]user@host# set term term-name-reject from community add community-nameuser@host# set term term-name-reject then reject
- Define the export policy’s community using one of
the following commands.[edit policy-options policy-statement export-policy-name]user@host# community community-name target: as-numberuser@host# community community-name target: ip-address:number
- Commit the configuration if you are finished configuring
the device. [edit]user@host# commit