Description

By default, when creating aggregate route, it receives all AS path of contributing routes.  This article explains how to create an aggregate route with an empty path.

Symptoms

Example output:

root@r3# run show route   
inet.0: 14 destinations, 19 routes (14 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
172.16.0.0/16         *[BGP/170] 00:00:04, localpref 100, from X.X.X.X
                      AS path: 65002 {65002 65006 65007} I, validation-state: unverified ---> All contributing AS number show out
                    > to 12.0.0.1 via ge-0/0/0.0
172.16.1.0/24         *[BGP/170] 00:10:53, localpref 100, from X.X.X.X
                      AS path: 65002 65002 I, validation-state: unverified
                    > to 12.0.0.1 via ge-0/0/0.0
172.16.2.0/24         *[BGP/170] 00:10:53, localpref 100, from X.X.X.X
                      AS path: 65002 65006 I, validation-state: unverified
                    > to 12.0.0.1 via ge-0/0/0.0
172.16.3.0/24         *[BGP/170] 00:10:53, localpref 100, from X.X.X.X
                      AS path: 65002 65007 I, validation-state: unverified
                    > to 12.0.0.1 via ge-0/0/0.0
root@r2# run show route 172.16.0.0/16 extensive                    
inet.0: 13 destinations, 16 routes (13 active, 0 holddown, 0 hidden)
172.16.0.0/16 (1 entry, 1 announced)
TSI:
KRT in-kernel 172.16.0.0/16 -> {}
Page 0 idx 0, (group ebgp type External) Type 1 val 0x955646c (adv_entry)
   Advertised metrics:
     Nexthop: Self
     AS path: [65002] {65002 65006 65007} I (LocalAgg)
     Communities:
Path 172.16.0.0 Vector len 4.  Val: 0
        *Aggregate Preference: 130
                Next hop type: Discard
                Address: 0x9293464
                Next-hop reference count: 3
                State: <Active Int Ext>
                Local AS: 65002
                Age: 1d 0:29:17
                Validation State: unverified
                Task: Aggregate
                Announcement bits (3): 0-KRT 5-BGP_RT_Background 6-Resolve tree 1
                AS path: {65002 65006 65007} I (LocalAgg) --->All AS path appear.
                                Flags: Discard  Depth: 0        Active
                AS path list:
                AS path: 65007 I Refcount: 1
                AS path: 65002 I Refcount: 1
                AS path: 65006 I Refcount: 1
                Contributing Routes (3):
                        172.16.1.0/24 proto Static
                        172.16.2.0/24 proto Static
                        172.16.3.0/24 proto Static

Solution

This is a BGP default behavior.

Add the following configuration on r2:
[edit routing-options]
root@r2# show
aggregate {
    route 172.16.0.0/16 {
        as-path {
            origin igp;                
        }
        discard;
    }
}

Verification on r3: 

root@r3# run show route   
 inet.0: 14 destinations, 19 routes (14 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
172.16.0.0/16         *[BGP/170] 00:00:03, localpref 100, from 2.2.2.2
                      AS path: 65002 I, validation-state: unverified ---> All contributing route's AS number has been removed.
                    > to 12.0.0.1 via ge-0/0/0.0
172.16.1.0/24         *[BGP/170] 00:12:36, localpref 100, from 2.2.2.2
                      AS path: 65002 65002 I, validation-state: unverified
                    > to 12.0.0.1 via ge-0/0/0.0
172.16.2.0/24         *[BGP/170] 00:12:36, localpref 100, from 2.2.2.2
                      AS path: 65002 65006 I, validation-state: unverified
                    > to 12.0.0.1 via ge-0/0/0.0
172.16.3.0/24          *[BGP/170] 00:12:36, localpref 100, from 2.2.2.2
                      AS path: 65002 65007 I, validation-state: unverified

Verification on r2:

root@r2# run show route 172.16.0.0/16 extensive                 
inet.0: 13 destinations, 16 routes (13 active, 0 holddown, 0 hidden)
172.16.0.0/16 (1 entry, 1 announced)
TSI:
KRT in-kernel 172.16.0.0/16 -> {}
Page 0 idx 0, (group ebgp type External) Type 1 val 0x955646c (adv_entry)
   Advertised metrics:
     Nexthop: Self
     AS path: [65002] I
     Communities:
Path 172.16.0.0 Vector len 4.  Val: 0
        *Aggregate Preference: 130
                Next hop type: Discard
                Address: 0x9293464
                Next-hop reference count: 3
                State: <Active Int Ext>
                Local AS: 65002
                Age: 23:23:29
                Validation State: unverified
                Task: Aggregate
                Announcement bits (3): 0-KRT 5-BGP_RT_Background 6-Resolve tree 1
                AS path: I ---> There is no As number
                                Flags: Discard  Depth: 0        Active
                Contributing Routes (3):
                        172.16.1.0/24 proto Static
                        172.16.2.0/24 proto Static
                        172.16.3.0/24 proto Static

Related Information