[j-nsp] generate a default route question

alain.briant at bt.com alain.briant at bt.com
Mon Dec 1 12:58:19 EST 2008


Hi William

Its much more simple to do it:

You only need to do a static route pointing to a next-hop that is on your 1.1.1.0/24 network
Even if this next hop doesn't exist.
Lets assume that your local interface is 1.1.1.1/24
You can write the static route like this:

 
routing-options {
    static {
        route 0.0.0.0/0 next-hop 1.1.1.2;
    }
}


You will have this in the routing table:

lab at toto> show route 

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

0.0.0.0/0          *[Static/5] 00:03:52
                    > to 1.1.1.2 via ge-x/y/z

Depending on the state of the interface ge-x/y/z

Hope this helps
Alain







 

-----Message d'origine-----
De : juniper-nsp-bounces at puck.nether.net [mailto:juniper-nsp-bounces at puck.nether.net] De la part de William Jackson
Envoyé : lundi 1 décembre 2008 17:52
À : juniper-nsp at puck.nether.net
Objet : [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