[j-nsp] BCP for anchoring local prefixes for redistribution into BGP

Jason Lixfeld jason at lixfeld.ca
Tue Dec 1 14:40:24 EST 2009


In Cisco land, I'm used to something like this:

!
router bgp 1
 network 1.1.1.0 mask 255.255.255.0 route-map LOCAL
 neighbor 2.2.2.2 remote-as 2
 neighbor 2.2.2.2 route-map ANNOUNCE out
!
ip bgp-community new-format
ip community-list standard LOCAL permit 1:790
!
route-map LOCAL permit 10
 set community 1:790
 set local-preference 790
!
route-map ANNOUNCE permit 10
 match community LOCAL
 set community none
!

There's no direct JunOS equivalent to network x mask y route-map LOCAL, so I'm wondering if someone can point me in the direction of a way to accomplish the same thing in a reasonably similar manner.  I've seen something like this, but is there a Better Way?

routing-options {
    autonomous-system 1;
}
protocols {
    bgp {
        group foo {
            type external;
            export ANNOUNCE;
            neighbor 2.2.2.2 {
                family inet {
                    unicast;
                }   
                peer-as 2;
            }       
        }           

prefix-list local-routes {
    1.1.1.0/24;
}
policy-statement ANNOUNCE {
    term local-routes {
        from community LOCAL;
        then {
            community delete all;
            accept;
        }
    }
    term default {
        then reject;
    }
}
policy-statement LOCAL {
    term local-routes {
        from {
            prefix-list local-routes;
        }
        then {
            local-preference 790;
            community add LOCAL;
            next-hop self;
            accept;
        }
    }
}
community LOCAL members 1:790;

The Cisco method seems much less wordy than the JunOS equivalent.  Is this JunOS syntax just one way to do this that happens to be a bit on the wordy side, but a simpler (read: less wordy) method does in fact exist?

Thanks in advance.


More information about the juniper-nsp mailing list