Objective: Set up an aggregate entry in the BGP table which can only be created with if more-specific routes of the aggregate exist in the routing table.
Main purposed is to avoid routing loops for example when a particular network were deleted
Syntax: aggregate-address
Below is the high Level Configuration steps:
- Configure the Loopbacks and the WAN Interface of both routers.
- Configure BGP and advertise the network addresses
- Add the aggregate-address commands from the BGP instance
- Verifications
Step 1. Configure Router 1 & 2 Loopback and Serial Interface:
Details of interface should be shown below
R1#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet0/1 unassigned YES unset administratively down down
FastEthernet1/0 unassigned YES unset administratively down down
Serial2/0 12.12.12.1 YES manual up up
Serial2/1 unassigned YES unset administratively down down
Serial2/2 unassigned YES unset administratively down down
Serial2/3 unassigned YES unset administratively down down
Loopback0 10.10.10.1 YES manual up up
Loopback1 10.10.11.1 YES manual up up
Loopback2 10.10.12.1 YES manual up up
Loopback3 10.10.13.1 YES manual up up
R2#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet0/1 unassigned YES unset administratively down down
FastEthernet1/0 unassigned YES unset administratively down down
Serial2/0 12.12.12.2 YES manual up up
Serial2/1 unassigned YES unset administratively down down
Serial2/2 unassigned YES unset administratively down down
Serial2/3 unassigned YES unset administratively down down
Loopback0 20.20.20.1 YES manual up up
Loopback1 20.20.21.1 YES manual up up
Loopback2 20.20.22.1 YES manual up up
Loopback3 20.20.23.1 YES manual up up
Step 2. Configure BGP on both Router 1 and Router 2.
R1#sh run | sec router bgp
router bgp 1
no synchronization
bgp log-neighbor-changes
network 10.10.10.0 mask 255.255.255.0
network 10.10.11.0 mask 255.255.255.0
network 10.10.12.0 mask 255.255.255.0
network 10.10.13.0 mask 255.255.255.0
neighbor 12.12.12.2 remote-as 2
no auto-summary
R2#sh run | sec router bgp
router bgp 2
no synchronization
bgp log-neighbor-changes
network 20.20.20.0
network 20.20.21.0
network 20.20.22.0
network 20.20.23.0
neighbor 12.12.12.1 remote-as 1
no auto-summary
R2#
Check that the routes were advertise on both routers::
Router 2 is receiving the 4 network segments advertise from router 1.
R2#sh ip bgp
BGP table version is 9, local router ID is 20.20.23.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.10.10.0/24 12.12.12.1 0 0 1 i
*> 10.10.11.0/24 12.12.12.1 0 0 1 i
*> 10.10.12.0/24 12.12.12.1 0 0 1 i
*> 10.10.13.0/24 12.12.12.1 0 0 1 i
*> 20.20.20.0/24 0.0.0.0 0 32768 i
*> 20.20.21.0/24 0.0.0.0 0 32768 i
*> 20.20.22.0/24 0.0.0.0 0 32768 i
*> 20.20.23.0/24 0.0.0.0 0 32768 i
With out the aggregate-address command on BGP, once the network 10.10.11.0/24 is disabled or down from router, the host is not reachable from router 2.
R2#clear ip bgp *
R2#sh ip bgp summary
BGP router identifier 20.20.23.1, local AS number 2
BGP table version is 8, main routing table version 8
7 network entries using 840 bytes of memory
7 path entries using 364 bytes of memory
3/2 BGP path/bestpath attribute entries using 372 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Bitfield cache entries: current 1 (at peak 1) using 32 bytes of memory
BGP using 1632 total bytes of memory
BGP activity 32/25 prefixes, 32/25 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
12.12.12.1 4 1 167 162 8 0 0 00:00:00 3
R2#sh ip bgp
BGP table version is 8, local router ID is 20.20.23.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.10.10.0/24 12.12.12.1 0 0 1 i
*> 10.10.12.0/24 12.12.12.1 0 0 1 i
*> 10.10.13.0/24 12.12.12.1 0 0 1 i
*> 20.20.20.0/24 0.0.0.0 0 32768 i
*> 20.20.21.0/24 0.0.0.0 0 32768 i
*> 20.20.22.0/24 0.0.0.0 0 32768 i
*> 20.20.23.0/24 0.0.0.0 0 32768 i
R2#ping 10.10.11.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.11.1, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)
R2#
Step 3. Enable the aggregate address from Router 1.. I have used CIDR to identify the common bits.
|
IP Address
|
Decimal of Third Octet
|
Binary equivalent of 3rd Octet
|
Equivalent CIDR
(Aggregate Address)
|
|
10.10.10.0/24
|
10
|
0001010
|
10.10.10.0/23
|
|
10.10.11.0/24
|
11
|
0001011
|
|
|
10.10.12.0/24
|
12
|
0001100
|
10.10.12.0/23
|
|
10.10.13.0/24
|
13
|
0001101
|
R1(config)#router bgp 1
R1(config-router)#aggr
R1(config-router)#aggregate-address 10.10.10.0 255.255.254.0
R1(config-router)#aggregate-address 10.10.12.0 255.255.254.0
R1(config-router)#
Check the Routes received on Router 2.
R2#sh ip bgp
BGP table version is 11, local router ID is 20.20.23.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.10.10.0/24 12.12.12.1 0 0 1 i
*> 10.10.10.0/23 12.12.12.1 0 0 1 i
*> 10.10.11.0/24 12.12.12.1 0 0 1 i
*> 10.10.12.0/24 12.12.12.1 0 0 1 i
*> 10.10.12.0/23 12.12.12.1 0 0 1 i
*> 10.10.13.0/24 12.12.12.1 0 0 1 i
*> 20.20.20.0/24 0.0.0.0 0 32768 i
*> 20.20.21.0/24 0.0.0.0 0 32768 i
*> 20.20.22.0/24 0.0.0.0 0 32768 i
*> 20.20.23.0/24 0.0.0.0 0 32768 i
Notice that the routes shown in router for the two aggregate address is shown
R1#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/24 is subnetted, 4 subnets
B 20.20.20.0 [20/0] via 12.12.12.2, 00:11:02
B 20.20.21.0 [20/0] via 12.12.12.2, 00:11:02
B 20.20.22.0 [20/0] via 12.12.12.2, 00:11:02
B 20.20.23.0 [20/0] via 12.12.12.2, 00:11:02
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C 10.10.10.0/24 is directly connected, Loopback0
B 10.10.10.0/23 [200/0] via 0.0.0.0, 00:08:25, Null0
C 10.10.11.0/24 is directly connected, Loopback1
C 10.10.12.0/24 is directly connected, Loopback2
B 10.10.12.0/23 [200/0] via 0.0.0.0, 00:08:22, Null0
C 10.10.13.0/24 is directly connected, Loopback3
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial2/0
Now disable Loopback 1 on Router 1 and ping the loopback address of Loopback 1 from R2.
R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int lo1
R1(config-if)#shut
R1(config-if)#^Z
R1#sh run int
*Mar 1 07:28:08.758: %SYS-5-CONFIG_I: Configured from console by console
R1#sh run int lo1
Building configuration…
Current configuration : 74 bytes
!
interface Loopback1
ip address 10.10.11.1 255.255.255.0
shutdown
end
R2#ping 10.10.11.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.11.1, timeout is 2 seconds:
UUUUU
Success rate is 0 percent (0/5)
R2#
The purposed of which is to avoid routing loop if both the network address is advertised and aggregate address.
Leave a comment