[j-nsp] l2circuit communities

Richard A Steenbergen ras at e-gerbil.net
Sat May 22 14:43:14 EDT 2010


On Mon, May 17, 2010 at 10:34:40PM -0400, Truman Boyes wrote:
> Hi Richard, 
> 
> You can likely achieve this a different way, (although you approach
> has interested me to check it out), by using CBF based on communities.
> I would use communities for the l2circuits, then associate those
> communities with a cos-next-hop-map, and have a forwarding policy
> exported to the FIB. 
> 
> Of course this is only useful if you feel like making l2circuits use a
> specific cos mapping in your network. 

FYI it turned out the problem was the preference I was setting on the
transport LSPs I didn't want being automatically used for IP routes.
Basically the only way to make this setup work is to have a big pile of
LSPs with equal preference so they can all make their way to the
forwarding table, then you have to do 100% of the LSP selection using a
forwarding-table export policy-statement, including selection for all of
your IP routes.

My final policy ended up being:

term PRIORITY-GOLD {
    from community TAG_PRIORITY_GOLD;
    then {
        install-nexthop lsp-regex .*-GOLD.*;
        load-balance per-packet;
        accept;
    }
}
term PRIORITY-SILVER {
    from community TAG_PRIORITY_SILVER;
    then {
        install-nexthop lsp-regex .*-SILVER.*;
        load-balance per-packet;
        accept;
    }
}
term PRIORITY-BRONZE {
    from community TAG_PRIORITY_BRONZE;
    then {
        install-nexthop lsp-regex .*-BRONZE.*;
        load-balance per-packet;
        accept;
    }
}
term PRIORITY-LEAD {
    from community TAG_PRIORITY_LEAD;
    then {
        install-nexthop lsp-regex .*-LEAD.*;
        load-balance per-packet;
        accept;
    }
}
term INTERNET-DEFAULT {
    from protocol [ bgp isis ospf rsvp ldp ];
    then {
        install-nexthop lsp-regex .*-BRONZE.*;
        load-balance per-packet;
        accept;
    }
}
then {
    load-balance per-packet;
    accept;
}


The weird thing about this is that a "show route" for bgp shows the 
correct LSPs that you selected in forwarding policy, for example here is 
a default bronze internet route showing only the bronze LSPs selected:

xxx.xxx.0.0/17     *[BGP/170] 16:19:42, MED 1000000000, localpref 300, from x.x.x.x.x
                      AS path: xxxxx I
                      to xx.xx.xxx.62 via xe-3/2/0.0, label-switched-path xxx.xxxx-yyy.yyyy-BRONZE-1
                      to xx.xx.xxx.62 via xe-3/2/0.0, label-switched-path xxx.xxxx-yyy.yyyy-BRONZE-2
                      to xx.xx.xxx.30 via xe-1/2/0.0, label-switched-path Bypass->xx.xx.xxx.62->xx.xx.xxx.85
                      to xx.xx.xxx.30 via xe-1/2/0.0, label-switched-path Bypass->xx.xx.xxx.62->xx.xx.xxx.85

BUT, for isis, rsvp, and ldp, the show route is incorrect. It shows all 
of the possible LSPs from before the forwarding-table policy is applied:

xx.xx.xx.xxx/32    *[RSVP/7] 16:19:55, metric 680
                      to xx.xx.xxx.30 via xe-1/2/0.0, label-switched-path xxx.xxxx-yyy.yyyy-GOLD-1
                      to xx.xx.xxx.9 via xe-0/0/0.0, label-switched-path xxx.xxxx-yyy.yyyy-GOLD-2
                      to xx.xx.xxx.9 via xe-0/0/0.0, label-switched-path xxx.xxxx-yyy.yyyy-SILVER-1
                      to xx.xx.xxx.30 via xe-1/2/0.0, label-switched-path xxx.xxxx-yyy.yyyy-SILVER-2
                    > to xx.xx.xxx.9 via xe-0/0/0.0, label-switched-path xxx.xxxx-yyy.yyyy-BRONZE-1
                      to xx.xx.xxx.30 via xe-1/2/0.0, label-switched-path xxx.xxxx-yyy.yyyy-BRONZE-2
                      to xx.xx.xxx.30 via xe-1/2/0.0, label-switched-path xxx.xxxx-yyy.yyyy-LEAD-1
                      to xx.xx.xxx.9 via xe-0/0/0.0, label-switched-path xxx.xxxx-yyy.yyyy-LEAD-2
                      to xx.xx.xxx.9 via xe-0/0/0.0, label-switched-path Bypass->xx.xx.xxx.30
                      to xx.xx.xxx.30 via xe-1/2/0.0, label-switched-path Bypass->xx.xx.xxx.9
                      to xx.xx.xxx.30 via xe-1/2/0.0, label-switched-path Bypass->xx.xx.xxx.9
                      to xx.xx.xxx.9 via xe-0/0/0.0, label-switched-path Bypass->xx.xx.xxx.30
                      to xx.xx.xxx.30 via xe-1/2/0.0, label-switched-path Bypass->xx.xx.xxx.9
                      to xx.xx.xxx.9 via xe-0/0/0.0, label-switched-path Bypass->xx.xx.xxx.30
                      to xx.xx.xxx.9 via xe-0/0/0.0, label-switched-path Bypass->xx.xx.xxx.30
                      to xx.xx.xxx.30 via xe-1/2/0.0, label-switched-path Bypass->xx.xx.xxx.9

But the correct LSPs are still being installed to hardware:

ras at re1.xxx.xxxx> show route forwarding-table matching xx.xx.xx.xxx/32 
Routing table: default.inet
Internet:
Destination        Type RtRef Next hop           Type Index NhRef Netif
xx.xx.xx.xxx/32    user     1                    ulst 1049298   171
                              xx.xx.xxx.9        ucst  1271     1 xe-0/0/0.0
                              xx.xx.xxx.30       ucst  1275     1 xe-1/2/0.0
                              xx.xx.xxx.30       ucst  2056     1 xe-1/2/0.0
                              xx.xx.xxx.9        ucst  2057     1 xe-0/0/0.0

This is on 9.5R4, with bgp-igp-both-ribs. If anybody has any ideas for 
cleaning up this last cosmetic issue, I'm all ears. :)

-- 
Richard A Steenbergen <ras at e-gerbil.net>       http://www.e-gerbil.net/ras
GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41 5ECA F8B1 2CBC)


More information about the juniper-nsp mailing list