Select Page

GENERATE ROUTES

Generate Routes

‘Generate’ routes are very similar. In fact, they are a type of aggregate route.  The aggregate routes are default to reject and do not forward traffic.  The generate route do not discard, instead used to forward the traffic. It have a forwarding next-hop which is associated to a primary contributing route.  So traffic that doesn’t match a contributing route will not be  dropped by default.Instead, any traffic that matches the generate route, but not one of the contributing routes will be forwarded to the next-hop of the first contributing route. 

A generated route is an aggregated route in routing table. How is the first contributing route decided? First the router will look at the route with the lowest protocol preference. For example, static routes will be preferred before OSPF routes. As a tie-breaker, the route with the lowest IP is used. For example, 10.0.0.0 /24 is preferred to 172.16.0.0 /30.

But when would you use a generate route? First, these would typically be used with a routing policy, which lists the routes which may be considered as contributing routes. Second, they are typically used with default routes. The policy will include upstream routes. This allows the router to advertise the default route to neighbors, and forward traffic accordingly, while still monitoring if the connection is up.

Note: generate route may have next-hop discard, if asked by the administrator. In this case, generate route will be similar to aggregate route. But for generate route, you cannot specify next-hop reject.

The default priority of a generated route is 130

LAB:

** R1 injects an aggregated route to ISP using BGP.
** If ISP receives BGP routes from R1, than ISP will inject a default route to OSPF (b/w ISP and Customer).
** If ISP stop learning BGP route from R1., or there is connectivity lost to R1, than ISP ‘ll suppress (forcibly put an end to) default route to OSPF.
— This ‘ll be tested by shutting down BGP link at ISP

** On ISP: The generated route (BGP) and primary contributed route should have same hext-hop and outgoing interface (R1)
[email protected]> show route 0/0 exact detail
[email protected]> show route 10.10.4.0/22

— The generated route have inherited next-hop from primary Contributing Route.

** On customer-Z router, check default-route 0/0 is injected: [email protected]> show route 0/0

** Test: When ISP lost connectivity to R1, and 0/0 is suppressed to OSPF.
[email protected]# deactivate interfaces ge-0/0/5

Now check on Customer-Z and there ‘ll be NO 0/0 route;
[email protected]> show route 0/0 exact detail

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name R1
set system root-authentication encrypted-password “$1$rTWehPx5$nPL42fpA35Hbj0OeUeVoX0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/0 unit 0 family inet address 10.10.4.1/24
set interfaces ge-0/0/1 unit 0 family inet address 10.10.5.1/24
set interfaces ge-0/0/2 unit 0 family inet address 10.10.6.1/24
set interfaces ge-0/0/5 unit 0 family inet address 172.16.1.1/24
set routing-options aggregate route 10.10.4.0/22 policy aggregate-route
set routing-options generate defaults preference 130
set routing-options autonomous-system 100
set protocols bgp export export-route
set protocols bgp group external type external
set protocols bgp group external neighbor 172.16.1.2 peer-as 200
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ospf area 0.0.0.0 interface ge-0/0/2.0
set policy-options policy-statement aggregate-route term 1 from protocol direct
set policy-options policy-statement aggregate-route term 1 from route-filter 10.10.4.0/22 orlonger
set policy-options policy-statement aggregate-route term 1 then accept
set policy-options policy-statement aggregate-route term 2 then reject
set policy-options policy-statement export-route from protocol aggregate
set policy-options policy-statement export-route from route-filter 10.10.4.0/22 exact
set policy-options policy-statement export-route then accept

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name R2
set system root-authentication encrypted-password “$1$rTWehPx5$nPL42fpA35Hbj0OeUeVoX0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/0 unit 0 family inet address 10.10.4.2/24
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name R3
set system root-authentication encrypted-password “$1$rTWehPx5$nPL42fpA35Hbj0OeUeVoX0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/1 unit 0 family inet address 10.10.5.2/24
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name R4
set system root-authentication encrypted-password “$1$rTWehPx5$nPL42fpA35Hbj0OeUeVoX0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/2 unit 0 family inet address 10.10.6.2/24
set protocols ospf area 0.0.0.0 interface ge-0/0/2.0

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name ISP
set system root-authentication encrypted-password “$1$rTWehPx5$nPL42fpA35Hbj0OeUeVoX0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/0 unit 0 family inet address 192.168.10.1/24
set interfaces ge-0/0/5 unit 0 family inet address 172.16.1.2/24
deactivate interfaces ge-0/0/5
set routing-options generate route 0.0.0.0/0 policy gen-route-policy
set routing-options autonomous-system 200
set protocols bgp group external type external
set protocols bgp group external neighbor 172.16.1.1 peer-as 100
set protocols ospf export default-route
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
set policy-options policy-statement default-route term 1 from protocol aggregate
set policy-options policy-statement default-route term 1 from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-route term 1 then accept
set policy-options policy-statement gen-route-policy term 1 from protocol bgp
set policy-options policy-statement gen-route-policy term 1 then accept
set policy-options policy-statement gen-route-policy term 2 then reject

[email protected]> show configuration |display set
set version 14.1R4.8
set system host-name Customer-Z
set system root-authentication encrypted-password “$1$GYvI4s4D$S32QQVMM3wzoISHYsJydZ0”
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/0 unit 0 family inet address 192.168.10.2/24
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0

— R1:

set routing-options aggregate route 10.10.4.0/22 policy aggregate-route
set routing-options generate defaults preference 130

set protocols bgp export export-route
set policy-options policy-statement aggregate-route term 1 from protocol direct
set policy-options policy-statement aggregate-route term 1 from route-filter 10.10.4.0/22 orlonger
set policy-options policy-statement aggregate-route term 1 then accept
set policy-options policy-statement aggregate-route term 2 then reject

set policy-options policy-statement export-route from protocol aggregate
set policy-options policy-statement export-route from route-filter 10.10.4.0/22 exact
set policy-options policy-statement export-route then accept

— ISP:

set routing-options generate route 0.0.0.0/0 policy gen-route-policy
set protocols ospf export default-route

set policy-options policy-statement default-route term 1 from protocol aggregate
set policy-options policy-statement default-route term 1 from route-filter 0.0.0.0/0 exact
set policy-options policy-statement default-route term 1 then accept

set policy-options policy-statement gen-route-policy term 1 from protocol bgp
set policy-options policy-statement gen-route-policy term 1 then accept
set policy-options policy-statement gen-route-policy term 2 then reject

[email protected]> show route 10.10.4.0/22 exact detail

inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
10.10.4.0/22 (1 entry, 1 announced)
*Aggregate Preference: 130
Next hop type: Reject
Address: 0x92c4204
Next-hop reference count: 2
State: <Active Int Ext>
Local AS: 100
Age: 7:46
Validation State: unverified
Task: Aggregate
Announcement bits (2): 0-KRT 3-BGP_RT_Background
AS path: I (LocalAgg)
Flags: Depth: 0 Active
AS path list:
AS path: I Refcount: 3
Contributing Routes (3):
10.10.4.0/24 proto Direct
10.10.5.0/24 proto Direct
10.10.6.0/24 proto Direct

 

[email protected]> show route 0/0 exact detail

inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
0.0.0.0/0 (1 entry, 1 announced)
*Aggregate Preference: 130
Next hop type: Router, Next hop index: 556
Address: 0x9690438
Next-hop reference count: 4
Next hop: 172.16.1.1 via ge-0/0/5.0, selected
Session Id: 0x140
State: <Active Int Ext>
Local AS: 200
Age: 28
Validation State: unverified
Task: Aggregate
Announcement bits (2): 0-KRT 2-OSPF
AS path: I
Flags: Generate Depth: 0 Active
Contributing Routes (1):
10.10.4.0/22 proto BGP

[email protected]> show route 10.10.4.0/22

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

10.10.4.0/22 *[BGP/170] 00:29:21, localpref 100
AS path: 100 I, validation-state: unverified
> to 172.16.1.1 via ge-0/0/5.0

[email protected]Customer-Z> show route 0/0

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

0.0.0.0/0 *[OSPF/150] 00:13:23, metric 0, tag 0
> to 192.168.10.1 via ge-0/0/0.0

** Test: When ISP lost connectivity to R1, and 0/0 is suppressed to OSPF.

[email protected]ISP# deactivate interfaces ge-0/0/5

Now check on Customer-Z and there ‘ll be NO 0/0 route;

[email protected]Customer-Z> show route 0/0

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

192.168.10.0/24 *[Direct/0] 01:08:32
> via ge-0/0/0.0
192.168.10.2/32 *[Local/0] 01:08:32
Local via ge-0/0/0.0
224.0.0.5/32 *[OSPF/10] 01:08:32, metric 1
MultiRecv

Share on print
Print
Share on google
Google+
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

The Juniper All-Access | Reading List

Leave a reply

Your email address will not be published. Required fields are marked *

ADENTECH guides

We love to help.

Get our newsletter, join the community: