inet.0: 6 destinations, 13 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.0/30 *[Static/5] 19w3d 09:40:52 > to 10.0.10.10 via ge-1/3/2
routing-options { aggregate { route 10.0.0.0/8 policy aggregate-contribute-routes; }
policy-options { prefix-list contribute-1 { 10.0.0.0/30; ## contribute route 10.0.1.0/30; 10.0.2.0/30; 10.1.1.1/32; 10.1.1.2/32; 10.1.1.3/32; } policy-statement aggregate-contribute-routes { term 1 { from { prefix-list contribute-1; } then accept; } }
inet.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 1.0.0.0/30 *[Direct/0] 00:38:45 > via ge-0/0/2.0 1.0.0.2/32 *[Local/0] 00:38:45 Local via ge-0/0/2.0 10.0.0.0/8 *[Aggregate/130] 00:23:27 Reject ## next-hop reject 10.0.0.0/30 *[BGP/170] 00:31:03, MED 0, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0 10.0.1.0/30 *[BGP/170] 00:31:03, MED 0, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0 10.0.2.0/30 *[BGP/170] 00:31:03, MED 4500, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0 10.1.1.1/32 *[BGP/170] 00:31:03, MED 0, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0 10.1.1.2/32 *[BGP/170] 00:31:03, MED 4500, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0 10.1.1.3/32 *[BGP/170] 00:31:03, MED 4500, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0
[edit] root# run show route advertising-protocol bgp 20.1.1.2 inet.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 10.0.0.0/8 Self 100 200 ?
[edit routing-options] root# show generate { route 10.0.0.0/8 policy aggregate-contribute-routes; policy-options { prefix-list contribute-1 { 10.0.0.0/30; ## contribute route 10.0.1.0/30; 10.0.2.0/30; 10.1.1.1/32; 10.1.1.2/32; 10.1.1.3/32; } policy-statement aggregate-contribute-routes { term 1 { from { prefix-list contribute-1; } then accept; } }
R5#sh ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 20.0.0.0/8 is variably subnetted, 5 subnets, 2 masks C 20.0.0.0/30 is directly connected, GigabitEthernet1/0 C 20.0.1.0/30 is directly connected, GigabitEthernet2/0 C 20.1.1.2/32 is directly connected, Loopback0 O 20.0.2.0/30 [110/2] via 20.0.1.2, 00:00:07, GigabitEthernet2/0 O 20.1.1.3/32 [110/2] via 20.0.1.2, 00:00:07, GigabitEthernet2/0 B 10.0.0.0/8 [200/0] via 20.1.1.1, 00:01:36 ##
inet.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 1.0.0.0/30 *[Direct/0] 00:35:07 > via ge-0/0/2.0 1.0.0.2/32 *[Local/0] 00:35:07 Local via ge-0/0/2.0 10.0.0.0/8 *[Aggregate/130] 00:19:49 > to 1.0.0.1 via ge-0/0/2.0 ## next-hop 10.0.0.0/30 *[BGP/170] 00:27:25, MED 0, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0 10.0.1.0/30 *[BGP/170] 00:27:25, MED 0, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0 10.0.2.0/30 *[BGP/170] 00:27:25, MED 4500, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0 10.1.1.1/32 *[BGP/170] 00:27:25, MED 0, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0 10.1.1.2/32 *[BGP/170] 00:27:25, MED 4500, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0 10.1.1.3/32 *[BGP/170] 00:27:25, MED 4500, localpref 100 AS path: 200 ? > to 1.0.0.1 via ge-0/0/2.0
[edit] root# show routing-options generate { route 10.0.0.0/8 { policy aggregate-contribute-routes; discard; } }
root# run show route inet.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 1.0.0.0/30 *[Direct/0] 00:45:38 > via ge-0/0/2.0 1.0.0.2/32 *[Local/0] 00:45:38 Local via ge-0/0/2.0 10.0.0.0/8 *[Aggregate/130] 00:30:20 Discard ## next-hop discard
10.0.0.0/8 *[Aggregate/130] 00:30:20
Source: https://habr.com/ru/post/274873/
All Articles