Network Enhancers - "Delivering Beyond Boundaries" Headline Animator

Saturday, May 28, 2011

Difference Between Static, Aggregate and Generate Routes in JUNOS.

In a nutshell:

- A static route is the most obvious. You need to be able to reach a certain prefix and you specify the next-hop. This is useful when you are not running dynamic routing protocols and/or when you want to override what a dynamic protocol dictates (since the protocol-preference for a static-route is lower -preferred- than that of any dynamic RP).

- An aggregate route is a route you define but which is not used for forwarding traffic (next-hop is discard or reject). It is purely used to advertise this router's connectivity which is why it needs at least one contributing route (a route which belongs to the advertised subnet but with a longer mask - these are the ones used to forward the traffic). Typically, the aggregate route would be advertised into BGP (if it is active thanks to contributing routes) - BGP does not like dealing with routes which are too specific - it prefers aggregates.

- A generated route is technically an aggregate route but which can be used to forward traffic. Traffic which matches the generated route (and not more specific routes) will be forwarded using the same next-hop as the first contributing route. A generated-route is typically combined with a policy to match which routes we want to be contributing and thus used as NHs. The generated-route is typically the default 0/0 with a policy matching to upstream routes - ie: provide connectivity if certain upstream routes exist.

Order of Preference of Nexthop in Generate Route.

- route with lowest protocol preference (eg: statics are preferred)
- route with numerically lowest IP address as tie breaker (eg: 10.1.1.0/24 is preferred over 11.1.1.0/30)



Generated routes are very similar to aggregate routes, with one exception: generated routes inherit a real next-hop interface, while aggregate routes only allow discard or reject as next-hops.
For example, the following config:
routing-options {
aggregate {
route 192.168.16.0/21;
}
generate {
route 10.0.0.0/16;
}
}
Results in:
lab@lab> show route protocol aggregate
inet.0: 57 destinations, 60 routes (57 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.0.0.0/16 *[Aggregate/130] 00:00:04
                   > via so-0/0/0.0 <<<<<<REAL NEXT HOP (inherited from contributor)
192.168.16.0/21 *[Aggregate/130] 1d 08:33:02
                         Reject <<<<<<Reject is the default (can be configured to discard)
Note that they both show up in the routing table as protcol type Aggregate.

3 comments:

  1. Nice post. Great blog. Thanks for the share. Keep updating such kind of information on your blog. I Just bookmarked it for continuous visit.
    html5 audio player

    ReplyDelete
  2. I absolutely love your website.. Great colors & theme.
    Did you build this amazing site yourself? Please reply back as I'm looking to create my very
    own site and want to learn where you got this from or what
    the theme is called. Appreciate it!

    Look into my site: mud runs 2014

    ReplyDelete
  3. When aggregated routes do not have any contributed route active it will be marked as rejected or discarded as per the selected action. But what will be the o/p if one of the contributed route is active, will the aggregated route will show as discarded or rejected?

    ReplyDelete

My Blog List

Networking Domain Jobs