Aggregate-Address As-Set

Scenario to verify BGP aggregate-address as-set configuration. The as-set option generates AS_SET path information for the aggregate route, preserving the AS path information from the contributing routes. This is useful for loop prevention when aggregating routes from multiple AS sources.

../../../../_images/topologyas-set1.svg

Test BGP Aggregate Address As-Set eBGP

Description

Test BGP aggregate-address as-set with eBGP. DUT0 (AS 10) receives route 192.168.1.0/24 from DUT1 (AS 20) and has local route 192.168.2.0/24. It aggregates both into 192.168.0.0/16 with as-set and announces to DUT2 (AS 30). With as-set, DUT2 sees AS_SET {20} in the path, preserving the origin AS information for loop prevention.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 192.168.2.1/24
set interfaces ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols bgp 10 aggregate-address 192.168.0.0/16 as-set
set protocols bgp 10 neighbor DUT1 remote-address 10.1.1.1
set protocols bgp 10 neighbor DUT1 remote-as 20
set protocols bgp 10 neighbor DUT1 route-map import PERMIT
set protocols bgp 10 neighbor DUT2 remote-address 10.2.2.2
set protocols bgp 10 neighbor DUT2 remote-as 30
set protocols bgp 10 neighbor DUT2 route-map export PERMIT
set protocols bgp 10 redistribute connected
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 192.168.1.1/24
set interfaces ethernet eth0 address 10.1.1.1/24
set protocols bgp 20 neighbor DUT0 remote-address 10.1.1.100
set protocols bgp 20 neighbor DUT0 remote-as 10
set protocols bgp 20 neighbor DUT0 route-map export PERMIT
set protocols bgp 20 redistribute connected
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Set the following configuration in DUT2 :

set interfaces ethernet eth1 address 10.2.2.2/24
set protocols bgp 30 neighbor DUT0 remote-address 10.2.2.100
set protocols bgp 30 neighbor DUT0 remote-as 10
set protocols bgp 30 neighbor DUT0 route-map import PERMIT
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify BGP sessions are established

Step 4: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:

10.1.1.1.*Established[\s\S]+10.2.2.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 192.168.2.1, local AS number 10 VRF default vrf-id 0
BGP table version 6
RIB entries 8, using 1024 bytes of memory
Peers 2, using 47 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.1.1.1        10.1.1.100      4         20         5         3        6    0    0 00:00:01  Established        2 (Policy) N/A
10.2.2.2        10.2.2.100      4         30         2         2        0    0    0 00:00:00  Established (Policy)        0 N/A

Total number of neighbors 2

Attention

Verify that DUT0 receives route 192.168.1.0/24 from DUT1 (AS 20)

Step 5: Run command protocols bgp show ip at DUT0 and check if output matches the following regular expressions:

[*].+192.168.1.0/24\s+10.1.1.1.+20\s+\?
Show output
BGP table version is 6, local router ID is 192.168.2.1, vrf id 0
Default local pref 100, local AS 10
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  10.1.1.0/24      0.0.0.0                  0         32768 ?
 *                    10.1.1.1                 0             0 20 ?
 *>  10.2.2.0/24      0.0.0.0                  0         32768 ?
 *>  192.168.0.0/16   0.0.0.0                  0         32768 {20} ?
 *>  192.168.1.0/24   10.1.1.1                 0             0 20 ?
 *>  192.168.2.0/24   0.0.0.0                  0         32768 ?

Displayed 5 routes and 6 total paths

Attention

Verify that DUT0 has the aggregate route 192.168.0.0/16 with AS_SET containing AS 20

Step 6: Run command protocols bgp show ip at DUT0 and check if output matches the following regular expressions:

[*].+192.168.0.0/16.+\{20\}\s+\?
Show output
BGP table version is 6, local router ID is 192.168.2.1, vrf id 0
Default local pref 100, local AS 10
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  10.1.1.0/24      0.0.0.0                  0         32768 ?
 *                    10.1.1.1                 0             0 20 ?
 *>  10.2.2.0/24      0.0.0.0                  0         32768 ?
 *>  192.168.0.0/16   0.0.0.0                  0         32768 {20} ?
 *>  192.168.1.0/24   10.1.1.1                 0             0 20 ?
 *>  192.168.2.0/24   0.0.0.0                  0         32768 ?

Displayed 5 routes and 6 total paths

Attention

Verify that DUT2 receives the aggregate route with AS 10 and AS_SET {20}

Step 7: Run command protocols bgp show ip at DUT2 and check if output matches the following regular expressions:

[*].+192.168.0.0/16\s+10.2.2.100.+10\s+\{20\}\s+\?
Show output
BGP table version is 5, local router ID is 10.2.2.2, vrf id 0
Default local pref 100, local AS 30
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *u  10.1.1.0/24      10.2.2.100               0             0 10 ?
 *u  10.2.2.0/24      10.2.2.100               0             0 10 ?
 *u  192.168.0.0/16   10.2.2.100               0             0 10 {20} ?
 *u  192.168.1.0/24   10.2.2.100                             0 10 20 ?
 *u  192.168.2.0/24   10.2.2.100               0             0 10 ?

Displayed 5 routes and 5 total paths