Routing

last person joined: 3 days ago 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
Expand all | Collapse all

Junos - Default route advertisement

  • 1.  Junos - Default route advertisement

    Posted 09-11-2013 04:44

    i like to create a policy for the conditional advertisement of default route to a bgp customer i.e. the default routes (0.0.0.0/0) only advertised if another route (say 1.1.0.0/16) presents. Following are two ways which comes into my mind and appreciate if  one can provide your feedback if the following can fullfill the requirement. If both can work than which one could be the recommended one.

     

    Thanks

     

    -------------------------------

    ---- OPTION 1 -----------------

    -------------------------------

     

    [edit routing-options]

     

    aggregate {

        route 1.1.0.0/16;

    }

    generate {

        route 0.0.0.0/0 discard;

    }

     

    [edit policy-options]

    policy-statement bgpcust-default-out {

        term 10 {

            from {

                route-filter 0.0.0.0/0 exact;

                route-filter 1.1.0.0/16 exact;

            }

            then {

                community delete all;

                accept;

            }

        }

    }

    community all members *:*;

     

    [edit protocols bgp]

    group External {

        neighbor 99.99.99.1 {

            export bgpcust-default-out;

            peer-as 65100;

        }

    }

     

     

     

    -------------------------------

    ---- OPTION 2 -----------------

    -------------------------------

     

    [edit routing-options]

     

    generate {

        route 0.0.0.0/0 {

            policy if-default-network-exists;

            discard;

        }

    }

     

    [edit policy-options]

    policy-statement if-default-network-exists {

        term DEFAULT_ROUTE {

            from {

                route-filter 1.1.0.0/16 exact;

            }

            then accept;

        }

        term reject-all-other-routes {

            then reject;

        }

    }

     

    policy-statement bgpcust-defaultroute-out {

        term 1 {

            from {

                route-filter 0.0.0.0/0 exact;

            }

            then {

                community delete all;

                accept;

            }          

        }

    }

    community all members *:*;

     

    [edit protocols bgp]

    group External {

        neighbor 100.100.100.1 {

            export bgpcust-defaultroute-out;

            peer-as 65100;

        }

    }



  • 2.  RE: Junos - Default route advertisement
    Best Answer

    Posted 09-11-2013 05:53

    Hi MSC,

     

    OPTION 2 will work for you and, it is the perfect way for conditional route advertisement..

     

    OPTION 1 will not work for you.

     

    Regards

    Satinder Singh



  • 3.  RE: Junos - Default route advertisement

    Posted 09-11-2013 06:16

    Hello Satinder,

    I tried to test it but the default route is not coming up in the routing table so it is not advertised to the peer. The other route 1.1.0.0/16 is in the routing table but it is also have discard so not sure if that making a difference.



  • 4.  RE: Junos - Default route advertisement

    Posted 09-11-2013 06:27

    HI MSC,

     

    Can you remove discard and see if it make any difference, I don't think it is a problem.

     

    Also please send the output of "sh route  1.1.0.0/16 detail"

     

    Regards

    Satinder



  • 5.  RE: Junos - Default route advertisement

    Posted 09-11-2013 06:36

    The matching route  (1.1.0.0/16) is generated from the route-reflector.  I tried to generate it locally using the aggregate command without discard but that didn't resolve the issue.

     

    1.1.0.0/16     *[BGP/170] 00:51:03, localpref 100, from x.x.x.11
                          AS path: I, validation-state: unverified
                          Discard
                        [BGP/170] 00:50:25, localpref 100, from x.x.x.22
                          AS path: I, validation-state: unverified
                          Discard



  • 6.  RE: Junos - Default route advertisement

    Posted 09-11-2013 06:57

    Hi,

     

    It looks issue with 1.1.0.0/16 route.

     

    Could you create a static route (1.1.0.0/16 ) with valid next hop (instead of discard). Hope this will activate 0/0 ?

     

    Regards

    Satinder Singh



  • 7.  RE: Junos - Default route advertisement

    Posted 09-11-2013 07:05

    It is kind of a supernet so there is no such valid next-hop and don't want to have traffic forwarded to 1.1.0.0/16 so that's why configuring it as discard.



  • 8.  RE: Junos - Default route advertisement

    Posted 09-11-2013 07:49

    One thing I don't get. If you are receiving the route from the RR, why do you have this?

     

    [edit routing-options]

     

    aggregate {

        route 1.1.0.0/16;

    }

     

    How does the route look like when you remove that bit of config?



  • 9.  RE: Junos - Default route advertisement

    Posted 09-11-2013 08:15

    Hello Satinder,

     

    I test the option 2 which DOESN'T have  the following statement. This statement is in option 1.

     

    aggregate {

        route 1.1.0.0/16;

    }



  • 10.  RE: Junos - Default route advertisement

    Posted 09-11-2013 08:51

    Can you send the output of:

     

    show route receive-protocol bgp 1.1.0.0/16 x.x.x.11

     

    Whatever x is. Thanks,

     

    Ato



  • 11.  RE: Junos - Default route advertisement

    Posted 09-11-2013 09:18

    Hello Ato,

    Here is the output. x.x.x.35 is the route reflector which has 1.1.0.0/16 defined as static route with discard.


    router#run show route receive-protocol bgp 1.1.0.0/16  x.x.x.35           

    inet.0: 375481 destinations, 375624 routes (375479 active, 0 holddown, 2 hidden)
    Restart Complete

    inet.3: 72 destinations, 72 routes (72 active, 0 holddown, 0 hidden)
    Restart Complete



  • 12.  RE: Junos - Default route advertisement

    Posted 09-11-2013 09:52

    export policy if-default-network-exists should be exported in bgp protocol. Give the export if-default-network-exists in the edit protocols bgp and check.

     

     



  • 13.  RE: Junos - Default route advertisement

    Posted 09-11-2013 09:55

    I am exporting "bgpcust-defaultroute-out". Why "if-default-network-exists" needed to be exported ?

    It is only to check and conditionally geenrate default route.



  • 14.  RE: Junos - Default route advertisement

    Posted 09-11-2013 16:52

    one modification

    policy-statement bgpcust-defaultroute-out {
    term 1 {
    from {
    protocol aggregate;
    route-filter 0.0.0.0/0 exact;
    }
    then {
    community delete all;
    accept;
    }
    }
    }
    community all members *:*;



  • 15.  RE: Junos - Default route advertisement

    Posted 09-11-2013 17:34

     

    policy-statement if-default-network-exists {
        term DEFAULT_ROUTE {
            from {
                route-filter 1.1.0.0/16 exact;
            }
            then accept;
        }
    }

    policy-statement bgpcust-default-out {
        term 10 {
            from {
                route-filter 1.1.0.0/16 exact;
            }
            then {
                community delete all-communities;
                accept;
            }
        }
        term 20 {
            then reject;
        }
    }



  • 16.  RE: Junos - Default route advertisement

    Posted 09-11-2013 17:00

    If the route is generated by bgp then you also need to modify statement like this:

    [edit policy-options]

    policy-statement if-default-network-exists {

        term DEFAULT_ROUTE {

            from {

                protocol bgp;

                route-filter 1.1.0.0/16 exact;

            }

            then accept;

        }

        term reject-all-other-routes {

            then reject;