Monday, October 14, 2013

How to map a specific VRF to a specific LSP


s there a way to bind a particular VRF to an MPLS LSP? I have 5 VRFs and 5 LSPs to the same destination (Egress-PE2). I want each VRF to take a specific LSP.
By default the VRFs choose the LSPs randomly: 
jnpr@router# run show route table VRF1 
VRF1.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
20.0.1.0/24        *[Static/5] 00:05:37
                    > to 192.2.1.2 via xe-1/0/0.2
10.0.1.0/24        *[BGP/170] 00:00:07, localpref 100, from 6.6.6.6
                      AS path: I
                      to 192.168.36.3 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-1
                    > to 192.168.36.3 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-2 <<<<<< Chosen LSP
                      to 192.168.36.3 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-3
                      to 192.168.36.3 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-4
                      to 192.168.36.3 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-5
Can I bind it say VRF1 chooses only lsp to-EGRESS-PE2-1?
Currently, VRF2 chooses only lsp to-EGRESS-PE2-2, etc...
Yes.

Config:
interfaces { 
    xe-0/0/0 { 
        unit 0 { 
            family inet { 
                address 192.168.15.5/24; 
            } 
            family mpls; 
        } 
    } 
    xe-0/1/0 { 
        description to-AGT-1601/1; 
        flexible-vlan-tagging; 
        encapsulation flexible-ethernet-services; 
        unit 2 { 
            vlan-id 2; 
            family inet { 
                address 192.2.1.1/24; 
            } 
        } 
        unit 3 { 
            vlan-id 3; 
            family inet { 
                address 192.2.2.1/24; 
            } 
        } 
    } 
    lo0 { 
        unit 0 { 
            family inet { 
                address 5.5.5.5/32; 
            } 
        } 
    } 
routing-options { 
    autonomous-system 100; 
    forwarding-table { 
        export lspmap; 
    } 
protocols { 
    rsvp { 
        interface all { 
            link-protection; 
        } 
        interface fxp0.0 { 
            disable; 
        } 
    } 
    mpls { 
        label-switched-path to-EGRESS-PE2-1 { 
            to 6.6.6.6; 
            bandwidth 1m; 
            node-link-protection; 
        } 
        label-switched-path to-EGRESS-PE2-2 { 
            to 6.6.6.6; 
            bandwidth 1m; 
            node-link-protection; 
        } 
        interface all; 
        interface fxp0.0 { 
            disable; 
        } 
    } 
    bgp { 
        group iBGP { 
            type internal; 
            local-address 5.5.5.5; 
            family inet { 
                any; 
            } 
            family inet-vpn { 
                any; 
            } 
            neighbor 6.6.6.6; 
        } 
    } 
    ospf { 
        traffic-engineering; 
        area 0.0.0.0 { 
            interface all; 
            interface fxp0.0 { 
                disable; 
            } 
        } 
    } 
policy-options { 
    policy-statement lspmap { 
        term VRF1 { 
            from { 
                rib bgp.l3vpn.0; 
                community VRF1-COM; 
            } 
            then { 
                install-nexthop strict lsp to-EGRESS-PE2-1; 
                accept; 
            } 
        } 
        term VRF2 { 
            from { 
                rib bgp.l3vpn.0; 
                community VRF2-COM; 
            } 
            then { 
                install-nexthop strict lsp to-EGRESS-PE2-2; 
            } 
        } 
    } 
    community VRF1-COM members target:200:1; 
    community VRF2-COM members target:200:2; 
routing-instances { 
    VRF1 { 
        instance-type vrf; 
        interface xe-0/1/0.2; 
        route-distinguisher 100:1; 
        vrf-target target:200:1; 
        vrf-table-label; 
        routing-options { 
            static
                route 20.0.1.0/24 next-hop 192.2.1.2; 
            } 
        } 
    } 
    VRF2 { 
        instance-type vrf; 
        interface xe-0/1/0.3; 
        route-distinguisher 100:2; 
        vrf-target target:200:2; 
        vrf-table-label; 
        routing-options { 
            static
                route 20.0.2.0/24 next-hop 192.2.2.2; 
            } 
        } 
    } 


BEFORE
jnpr@router# run show route 10.0.1.0/24 

VRF1.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.1.0/24        *[BGP/170] 00:50:03, localpref 100, from 6.6.6.6
                      AS path: I
                      to 192.168.15.1 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-1
                     > to 192.168.15.1 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-2

bgp.l3vpn.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

101:1:10.0.1.0/24                
                   *[BGP/170] 00:50:03, localpref 100, from 6.6.6.6
                      AS path: I
                      to 192.168.15.1 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-1
                     > to 192.168.15.1 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-2



AFTER

jnpr@router# run show route 10.0.1.0/24    

VRF1.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.1.0/24        *[BGP/170] 00:00:06, localpref 100, from 6.6.6.6
                      AS path: I
                    > to 192.168.15.1 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-1

bgp.l3vpn.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

101:1:10.0.1.0/24                
                   *[BGP/170] 00:50:29, localpref 100, from 6.6.6.6
                      AS path: I
                    > to 192.168.15.1 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-1


[edit]
jnpr@router# run show route 10.0.2.0/24    

VRF2.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.2.0/24        *[BGP/170] 00:00:18, localpref 100, from 6.6.6.6
                      AS path: I
                      to 192.168.15.1 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-2

bgp.l3vpn.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

101:2:10.0.2.0/24                
                   *[BGP/170] 00:50:41, localpref 100, from 6.6.6.6
                      AS path: I
                      to 192.168.15.1 via xe-0/0/0.0, label-switched-path to-EGRESS-PE2-2

Caveats:
There is a limitation if you have multiple LSPs to the same destinations. By Default the number of LSP next-hops are 16. You can expand it to 32-64 with this command.

user@router# set chassis maximum-ecmp ?
Possible completions:
  16                   Maximum 16 ECMP routes
  32                   Maximum 32 ECMP routes
  64                   Maximum 64 ECMP routes

So you can theoretically only map a maximum of 64 VRFs to 64 unique LSPs.




No comments:

Post a Comment