Routing

Expand all | Collapse all

Generated route - Policy applied but route not being installed?

Jump to Best Answer
  • 1.  Generated route - Policy applied but route not being installed?

    Posted 07-21-2017 00:48

    Hi all,

     

    I am trying to install a generated route using a policy referencing a direct link to an eBGP neigbor using vSRX.

     

    R9 <<< ----- >>> R8

     

    The basic configuration is:

     

    Default generated route

    ==================

     

    route 0.0.0.0/0 policy generated-route-default;

     

    Policy

    =====


    term 1 {
        from {
            protocol local;
            route-filter 84.10.113.0/30 exact;
        }
        then accept;
    }
    term 2 {
        then reject;
    }

     

     

    Routing details

    ============

     

    root@R8> show route protocol aggregate 0/0 hidden detail

    inet.0: 29 destinations, 39 routes (28 active, 0 holddown, 1 hidden)
    0.0.0.0/0 (1 entry, 0 announced)
             Aggregate
                    Next hop type: Reject
                    Address: 0x8f3d584
                    Next-hop reference count: 3
                    State: <Hidden Int Ext>
                    Local AS:  1282
                    Age: 38:54
                    Task: Aggregate
                    AS path: I
                                    Flags: Generate    Depth: 1    Inactive
    root@R8> show route 84.10.113.0/30

    inet.0: 29 destinations, 39 routes (28 active, 0 holddown, 1 hidden)
    + = Active Route, - = Last Active, * = Both

    84.10.113.0/30     *[Direct/0] 01:34:14
                        > via ge-0/0/7.0
    84.10.113.1/32     *[Local/0] 01:34:14
                          Local via ge-0/0/7.0

     

    Version

    ======

     

    Model: firefly-perimeter
    JUNOS Software Release [12.1X47-D20.7]

     

    Im probably missing something obvious here 🙂 but a nudge in the right direction would be appreciated 🙂

     

    Apologies in advance if the etiquete and formatting arent on point....this is my first tech post on the forums 😉



  • 2.  RE: Generated route - Policy applied but route not being installed?

    Posted 07-21-2017 02:15

    try to change from protocol local to protocol direct 

    or 

    change "route-filter 84.10.113.0/30 exact" to "route-filter 84.10.113.1/32 exact"

     

    compare your output of "show route " and configuration of policy



  • 3.  RE: Generated route - Policy applied but route not being installed?

    Posted 07-21-2017 02:23

    Hi Akushner,

     

    Thanks for the reply. I have tried both of those and still no luck.

    Martin



  • 4.  RE: Generated route - Policy applied but route not being installed?
    Best Answer

    Posted 07-21-2017 03:01

    Hi, 
     
    Direct routes for multiaccess networks cannot contribute to a generated route because a forwarding next hop cannot be derived from the mere presence of the local interface, as is possible in the case of a point-to-point link, where the interface itself can be specified as a next hop.


    Junos Enterprise Routing: A Practical Guide to Junos Routing and Certification, page 126



  • 5.  RE: Generated route - Policy applied but route not being installed?

    Posted 07-21-2017 03:03

    Hi Doods thanks for the information.



  • 6.  RE: Generated route - Policy applied but route not being installed?

    Posted 07-21-2017 03:05

    Reference: Junos Enterprise Routing: A Practical Guide to Junos Routing and Certification, page 126



  • 7.  RE: Generated route - Policy applied but route not being installed?

    Posted 07-21-2017 03:18

    Hi Doods,

     

    thanks for the pointer on the book and page reference. However on page 271 am I misreading that its a direct route conributing to the generated route on this:

     

    [edit]
    lab@Yeast#
    show routing-options generate
    route 0.0.0.0/0 policy gen_default;
    [edit]
    lab@Yeast#
    show policy-options policy-statement gen_default
    term 1 {
    from {
    protocol direct;
    route-filter 84.10.113.0/31 exact;
    }
    then accept;
    }
    term 2 {
    then reject;
    }
    The configuration results in the generation of a 0/0 route that, when matched, will
    forward over the next hop assigned to the preferred contributing route. Here, the set
    of possible contributors is constrained by the policy named
    gen_default, which matches
    only on the 84.10.113.0/31 route assigned to the
    t1-2/0/2 interface. The policy’s second term guarantees that no other route can contribute by rejecting all remaining routes
    and sources. Operation of the generated route is verified:
    [edit]
    lab@Yeast#
    run show route protocol aggregate detail
    inet.0: 17 destinations, 17 routes (17 active, 0 holddown, 0 hidden)
    0.0.0.0/0 (1 entry, 1 announced)
    *Aggregate Preference: 130
    Next-hop reference count: 2
    Next hop: via t1-2/0/2.0, selected
    State: <Active Int Ext>
    Age: 10:07
    Task: Aggregate
    Announcement bits (1): 0-KRT
    AS path: I
    Flags: Generate Depth: 0 Active
    Contributing Routes (1):
    84.10.113.0/31 proto Direct



  • 8.  RE: Generated route - Policy applied but route not being installed?

    Posted 07-21-2017 03:29

    Hi, 

     

    Yes beceause it is a point to point interface. (/31).



  • 9.  RE: Generated route - Policy applied but route not being installed?

    Posted 07-21-2017 03:31

    Great thanks 🙂



  • 10.  RE: Generated route - Policy applied but route not being installed?

    Posted 07-21-2017 11:30

    I still seem unable to get the Generated route to recognise the contributing route and install  0/0 into the route table?

     

    set interfaces ge-0/0/1 description "toR9-BGP Link to AS34"
    set interfaces ge-0/0/1 unit 0 family inet address 84.10.109.0/31

     

    set policy-options policy-statement generate term 1 from protocol direct
    set policy-options policy-statement generate term 1 from route-filter 84.10.109.0/31 exact
    set policy-options policy-statement generate term 1 then accept
    set policy-options policy-statement generate term 2 then reject

     

    set routing-options generate route 0.0.0.0/0 policy generate

     

    root@R8# run show route protocol aggregate hidden detail

    inet.0: 18 destinations, 18 routes (17 active, 0 holddown, 1 hidden)
    0.0.0.0/0 (1 entry, 0 announced)
    Aggregate
    Next hop type: Reject
    Address: 0x8f3d584
    Next-hop reference count: 1
    State: <Hidden Int Ext>
    Local AS: 1282
    Age: 17:50
    Task: Aggregate
    AS path: I
    Flags: Generate Depth: 0 Inactive

     

     

    root@R8# run show route | match 84     
    84.10.109.0/31     *[Direct/0] 00:35:58 >>>>>>>>> ge-0/0/1
    84.10.109.0/32     *[Local/0] 00:35:58
    84.10.113.0/30     *[Direct/0] 00:35:58
    84.10.113.1/32     *[Local/0] 00:35:58

     

    root@R8# run show route 84.10.109.0/31 detail

    inet.0: 18 destinations, 18 routes (17 active, 0 holddown, 1 hidden)
    84.10.109.0/31 (1 entry, 0 announced)
            *Direct Preference: 0
                    Next hop type: Interface
                    Address: 0x9350208
                    Next-hop reference count: 1
                    Next hop: via ge-0/0/1.0, selected
                    State: <Active Int>
                    Local AS:  1282
                    Age: 36:49
                    Task: IF
                    AS path: I

    84.10.109.0/32 (1 entry, 0 announced)
            *Local  Preference: 0
                    Next hop type: Local
                    Address: 0x8f3ede4
                    Next-hop reference count: 5
                    Next hop:
                    Interface: ge-0/0/1.0
                    State: <Active NoReadvrt Int>
                    Local AS:  1282
                    Age: 36:49              
                    Task: IF
                    AS path: I

     

    oot@R8# run show route

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

    10.10.10.5/32      *[OSPF/10] 00:37:56, metric 2
                        > to 192.168.0.2 via ge-0/0/6.0
    10.10.10.6/32      *[OSPF/10] 00:37:56, metric 2
                        > to 192.168.0.2 via ge-0/0/6.0
    10.10.10.7/32      *[OSPF/10] 00:37:56, metric 1
                        > to 192.168.0.2 via ge-0/0/6.0
    10.10.10.8/32      *[Direct/0] 00:38:11
                        > via lo0.0
    84.10.109.0/31     *[Direct/0] 00:38:11
                        > via ge-0/0/1.0
    84.10.109.0/32     *[Local/0] 00:38:11
                          Local via ge-0/0/1.0
    84.10.113.0/30     *[Direct/0] 00:38:11
                        > via ge-0/0/7.0
    84.10.113.1/32     *[Local/0] 00:38:11
                          Local via ge-0/0/7.0
    192.168.0.0/30     *[Direct/0] 00:38:11
                        > via ge-0/0/6.0
    192.168.0.1/32     *[Local/0] 00:38:11
                          Local via ge-0/0/6.0
    192.168.1.0/30     *[OSPF/10] 00:37:56, metric 2
                        > to 192.168.0.2 via ge-0/0/6.0
    192.168.2.0/30     *[OSPF/10] 00:37:56, metric 2
                        > to 192.168.0.2 via ge-0/0/6.0
    192.168.3.0/30     *[OSPF/10] 00:37:56, metric 3
                        > to 192.168.0.2 via ge-0/0/6.0
    192.168.4.0/30     *[OSPF/10] 00:37:56, metric 3
                        > to 192.168.0.2 via ge-0/0/6.0
    192.168.5.0/30     *[OSPF/10] 00:37:56, metric 4
                        > to 192.168.0.2 via ge-0/0/6.0
    192.168.6.0/30     *[OSPF/10] 00:37:56, metric 3
                        > to 192.168.0.2 via ge-0/0/6.0
    224.0.0.5/32       *[OSPF/10] 00:38:11, metric 1
                          MultiRecv



  • 11.  RE: Generated route - Policy applied but route not being installed?

    Posted 07-21-2017 12:43

    Hello,

    If Your goal is to send everything into ge-0/0/1 when it is up/up, then You won't be able to do it with generate route. Static 0/0 with next-hop 84.10.109.1 is the solution.

    If Your goal is to announce 0/0 route when ge-0/0/1 is up/up, then use "aggregate" route with discard NH, it will consider 84.10.109.0/31 as contributor.

     

    JUNOS CLI:

     

     

    set policy-options policy-statement generate term 1 from protocol direct
    set policy-options policy-statement generate term 1 from route-filter 84.10.109.0/31 exact
    set policy-options policy-statement generate term 1 then accept
    set policy-options policy-statement generate term 2 then reject
     
    set routing-options aggregate route 0.0.0.0/0 policy generate
    set routing-options aggregate route 0.0.0.0/0 discard ## not strictly necessary but stops wasteful ICMP Unreach generation

    And then match appropriately in Your IGP/BGP export policies.

    HTH

    Thx
    Alex



  • 12.  RE: Generated route - Policy applied but route not being installed?

    Posted 08-01-2017 04:58

    Hi,

     

    Apologies for the delayed reply 🙂 I'll try this later on and let you know how I get on.

     

    Thanks



  • 13.  RE: Generated route - Policy applied but route not being installed?

    Posted 06-24-2018 09:37

    Is it working for the book example because they're using a t1 interface and that's not considered a mulitaccess interface?



  • 14.  RE: Generated route - Policy applied but route not being installed?

    Posted 06-25-2018 08:59
    inet.0: 29 destinations, 39 routes (28 active, 0 holddown, 1 hidden)
    + = Active Route, - = Last Active, * = Both

    84.10.113.0/30 *[Direct/0] 01:34:14
    > via ge-0/0/7.0
    84.10.113.1/32 *[Local/0] 01:34:14
    Local via ge-0/0/


    First thing to understand is that as you are using and statement in term 1 from local and exact .
    So make it as from direct


  • 15.  RE: Generated route - Policy applied but route not being installed?

    Posted 06-25-2018 09:01
    As routing table shows in hidden routes , we cannot send