Configuring a VRF to Provide BGP VPN Services

To configure a VRF to provide BGP VPN services:

  1. Create the VRF.
    host1(config)#virtual-router vr1 host1:vr1(config)#ip vrf vrfA
  2. Assign a route distinguisher to the VRF.
    host1:vr1(config-vrf)#rd 100:100
  3. Set the route-target import and route-target export lists for the VRF.
    host1:vr1(config-vrf)#route-target import 100:1 host1:vr1(config-vrf)#route-target export 100:1
  4. (Optional) Set import and export maps for the VRF.
    host1:vr1(config-vrf)#import map Another-route-map host1:vr1(config-vrf)#export map A-route-map host1:vr1(config-vrf)#exit
  5. Assign interfaces for PE-to-CE links to the VRF from outside or inside the VRF context:
    host1:vr1(config)#interface gigabitEthernet 1/0 host1:vr1(config-if)#ip vrf forwarding vrfA host1:vr1:vrfA(config-if)#ip address host1:vr1:vrfA(config-if)#exit


    host1:vr1(config)#virtual-router :vrfA host1:vr1:vrfA(config)#interface gigabitEthernet 1/0

    Note: You can also use the ip vrf forwarding command to specify secondary route lookup at the parent (global) level, in the event the original lookup does not yield any results.

  6. Use either of the following methods to establish how the VRF learns routes to customer sites:
    • Create static routes to the customer site in the VRF by one of the following methods:
      host1(config)#virtual-router vr1 host1:vr1(config)#ip vrf vpnA host1:vr1(config-vrf)#ip route vrf vrfA host1:vr1(config-vrf)#ip route vrf vrfA


      host1(config)#virtual-router vr1:vrfA host1:vr1:vrfA(config)#ip route host1:vr1:vrfA(config)#ip route
    • Configure an IGP on the VRF to learn routes from the CE router.

      See Configuring the IGP in the VRF Context for examples.

    • Configure a PE-to-CE EBGP session.

      See Example: Configuring PE-to-CE BGP Sessions for information about configuring EBGP.

  7. (Optional) Configure the router to generate a label for each different FEC pointed to by a BGP route in the VPN.
    host1:vr1(config-vrf)#ip mpls forwarding-mode label-switched
  8. (Optional) For carrier-of-carriers VPNs, configure carrier-of-carriers mode in the provider carrier’s PE router that connects to the customer carrier’s network.
    host1:vr1:VrfA(config)#mpls topology-driven-lsp

    See Carrier-of-Carriers IPv4 VPNs Overview for information about configuring carrier-of-carriers VPNs. See Creating Multicast VPNs in JunosE Multicast Routing Configuration Guide.

Related Documentation