Junos OS

last person joined: yesterday 

Ask questions and share experiences about Junos OS.
  • 1.  leak a more specific route than the original route to another routing-instance

    Posted 06-26-2016 23:57

    Hi,

    I have  a BGP session there I receive a route with mask /16 

    I want to leake only the first /24 from the /16 to another routing instance.

     

    I know that I can use a static route with next-hop <another routing-instance>, but I would like to avoid this.

     

    Is it possible with RIB leaking?

     

    Configuration example?

     

    Thank Niklas



  • 2.  RE: leak a more specific route than the original route to another routing-instance

     
    Posted 06-27-2016 01:52

    Hi,

     

    I believe it would be possible to leak the routes if there's an active route for the /24 in the primary routing-table.

    Example:

     

    set routing-instances TEST protocols bgp family inet unicast rib-group BGP
    set routing-options rib-groups BGP import-rib [ TEST.inet.0 TEST1.inet.0 ]
    set routing-options rib-groups BGP import-policy IMPORT-RIB
    set policy-options policy-statement IMPORT-RIB term BGP from route-filter x.x.x.0/24 exact
    set policy-options policy-statement IMPORT-RIB term BGP then accept
    set policy-options policy-statement IMPORT-RIB then reject
    

    If there's no /24 active route in the primary routing-table, a static route for the /24 may need to be added.

     

    However, adding a static discard route to then leak in rib-groups would result in traffic blackhole.  So the /24 static route would require a valid next-hop.

     

    set routing-instances TEST routing-options static route x.x.x.0/24 next-hop z.z.z.z
    set routing-instances TEST routing-options static rib-group STATIC
    set routing-options rib-groups STATIC import-rib [ TEST.inet.0 TEST1.inet.0 ]
    set routing-options rib-groups STATIC import-policy IMPORT-RIB

    Cheers,

    Ashvin



  • 3.  RE: leak a more specific route than the original route to another routing-instance

    Posted 06-27-2016 02:48

    Hi,

    Is the static route I'm trying to avoid.

    If the /16 is removed from bgp the route leaking prefix should also disappear.

     

    //Niklas



  • 4.  RE: leak a more specific route than the original route to another routing-instance

     
    Posted 06-27-2016 03:47

    Hi, 

     

    Maybe you could use a generate route.


    Cheers,

    Ashvin



  • 5.  RE: leak a more specific route than the original route to another routing-instance

     
    Posted 06-27-2016 03:57

    Hi,

     

    Unfortunately, the generated route would not work as well as we are trying to generate a more specific route.

     

    "A generated route becomes active when it has one or more contributing routes. A contributing route is an active route that is a more specific match for the generated destination. For example, for the destination 128.100.0.0/16, routes to 128.100.192.0/19 and 128.100.67.0/24 are contributing routes, but routes to 128.0.0.0./8, 128.0.0.0/16, and 128.100.0.0/16 are not."

     

    Is it not possible to receive the /24 route from the BGP neighbor?

     

    Cheers,

    Ashvin



  • 6.  RE: leak a more specific route than the original route to another routing-instance

    Posted 06-27-2016 10:31

    unfortunately not

     

    //Niklas



  • 7.  RE: leak a more specific route than the original route to another routing-instance
    Best Answer

     
    Posted 06-27-2016 16:45

    Hi,

     

    Although it does not seem very neat, I believe you could do this by adding static route for the /24 with a next-hop resolve, the next-hop being a route part of the /16. Example:

    set routing-options static route 172.17.0.0/24 next-hop 172.17.255.254 resolve

    Test Result:

    root@PE1# run show route table TEST.inet.0 172.17.0.0/16 
    
    TEST.inet.0: 19 destinations, 23 routes (19 active, 0 holddown, 1 hidden)
    + = Active Route, - = Last Active, * = Both
    
    172.17.0.0/16      *[BGP/170] 00:20:40, localpref 100
                          AS path: 65001 I, validation-state: unverified
                        > to 10.2.2.2 via ge-0/0/5.0
    172.17.0.0/24      *[Static/5] 00:18:07, metric2 0
                        > to 10.2.2.2 via ge-0/0/5.0
    
    [edit]
    root@PE1# run show route table TEST1.inet.0 172.17.0.0      
    
    TEST1.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    172.17.0.0/24      *[Static/5] 00:00:24, metric2 0
                        > to 10.2.2.2 via ge-0/0/5.0
    

    When /16 is not present:

    root@PE1# run show route table TEST.inet.0 172.17.0.0/16    
    
    TEST.inet.0: 18 destinations, 22 routes (17 active, 0 holddown, 2 hidden)
    
    [edit]
    root@PE1# run show route table TEST1.inet.0 172.17.0.0/16   
    
    TEST1.inet.0: 5 destinations, 5 routes (4 active, 0 holddown, 1 hidden)
    
    [edit]
    root@PE1# run show route table TEST1.inet.0 172.17.0.0/16 hidden 
    
    TEST1.inet.0: 5 destinations, 5 routes (4 active, 0 holddown, 1 hidden)
    + = Active Route, - = Last Active, * = Both
    
    172.17.0.0/24       [Static/5] 00:00:19
                          Unusable
    
    [edit]
    root@PE1# run show route table TEST.inet.0 172.17.0.0/16 hidden     
    
    TEST.inet.0: 18 destinations, 22 routes (17 active, 0 holddown, 2 hidden)
    + = Active Route, - = Last Active, * = Both
    
    172.17.0.0/24       [Static/5] 00:23:49
                          Unusable

    Cheers,

    Ashvin