[j-nsp] generate a default route question

Tim Nagy tnagy76 at gmail.com
Tue Dec 2 00:32:50 EST 2008


Hi William,

As someone else pointed out, what you need is a static route, not a
generated route. You want to point your default gateway to a host on the
1.1.1/24 network, so set your route to 0/0 to that host. The static route
will be removed from the routing table if the interface goes down, so no
need to worry about it pointing into a black hole.

Generate routes by default take the next-hop of the primary contributing
route. However, your direct route of 1.1.1/24 doesn't have a next-hop
address since it's a broadcast interface. That's why the route is hidden.

Regards,
Tim

-----Original Message-----
From: juniper-nsp-bounces at puck.nether.net
[mailto:juniper-nsp-bounces at puck.nether.net] On Behalf Of William Jackson
Sent: Tuesday, 2 December 2008 3:52 AM
To: juniper-nsp at puck.nether.net
Subject: [j-nsp] generate a default route question

I have a test lab where I have an edge router that I want to use to
generate a default route into my OSPF process depending on whether an
interface is up or not.

 

Code snippets:

 

Show routing-options:

generate {

    route 0.0.0.0/0 {

        policy generate_default_route;

        tag 1000;

    }

}

 

Show policy-statement

policy-statement generate_default_route {

    term match_routes {

        from {

            protocol direct;

            route-filter 1.1.1.0/24 exact;

        }

        then accept;

    }

    term reject_all_other_candidate_direct_routes {

        then reject;

    }

}

 

Then to distribute it into OSPF once it is in the routing table:

 

policy-statement inject_default_into_ospf {

    term match_default {

        from {

            route-filter 0.0.0.0/0 exact;

        }

        then accept;

    }

    then reject;

}

 

Set Protocol ospf export inject_default_into_ospf;

 

So if the interface is up then the route 1.1.1.0/24 is in the routing
table as a direct route.

 

Problem is that even when it is up I don't see my default in the routing
table:

 

run show route hidden 

 

inet.0: 271174 destinations, 271234 routes (271174 active, 0 holddown, 1
hidden)

+ = Active Route, - = Last Active, * = Both

 

0.0.0.0/0           [Aggregate] 1w4d 07:44:01, tag 1000

                      Reject

 

It is there but hidden, why and how do I get it into the active routing
table?

 

 

 

_______________________________________________
juniper-nsp mailing list juniper-nsp at puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp



More information about the juniper-nsp mailing list