[j-nsp] Conditionally Generating Default Routes

Steve Feldman feldman at twincreeks.net
Fri May 8 19:47:28 EDT 2015


> On May 8, 2015, at 11:39 AM, Bill Blackford <bblackford at gmail.com> wrote:
> 
> I'm trying to engineer a simple solution to generate a default route. 
> ...
>  Is there a better solution to achieve the same
> objective?

Ignoring the whole discussion of whether this is a good idea, I’ve done this by checking for the presence of any BGP routes with next-hop set to one of my directly attached upstream neighbors:

routing-options {
    generate {
        route 0.0.0.0/0 policy upstream-routes;
    }
}
policy-options {
    policy-statement upstream-routes {
        term Provider1 {
            from next-hop a.b.c.d;
            then accept;
        }
        term Provider2 {
            from next-hop e.f.g.h;
            then accept;
        }
        term default {
            then reject;
        }
    }
}

    Steve


More information about the juniper-nsp mailing list