Network Requirements
- Set up OSPF neighbors between Device1 and Device3, and configure Device3 to advertise routes 100.1.0.0/24 and 100.2.0.0/24 to Device1.
- Set up EBGP neighbors between Device1 and Device2.
- On Device1, aggregate routes 100.1.0.0/24 and 100.2.0.0/24 into route 100.0.0.0/14 and advertise the aggregated route to Device2.
Network Topology
Figure 12–5 Networking for configuring BGP route summary
Configuration Steps
Step 1: Configure the VLAN and join the interface to the corresponding VLAN. (Omitted)
Step 2: Configure the IP addresses of the interfaces. (Omitted)
Step 3: Configure OSPF so that loopback routes are reachable between devices.
#Configure Device1.
Device1#configure terminal
Device1(config)#router ospf 100
Device1(config-ospf)#network 2.0.0.0 0.0.0.255 area 0
Device1(config-ospf)#exit
|
#Configure Device3.
Device3#configure terminal
Device3(config)#router ospf 100
Device3(config-ospf)#network 2.0.0.0 0.0.0.255 area 0
Device3(config-ospf)#network 100.1.0.0 0.0.0.255 area 0
Device3(config-ospf)#network 100.2.0.0 0.0.0.255 area 0
Device3(config-ospf)#exit
|
#Query the routing table of Device1.
Device1#show ip route ospf
Codes: C - Connected, L - Local, S - static, R - RIP, B - BGP, i-ISIS
U - Per-user Static route
O - OSPF, OE-OSPF External, M - Management, E - IRMP, EX - IRMP external
O 100.1.0.0/24 [110/2] via 2.0.0.2, 00:00:24, vlan3
O 100.2.0.0/24 [110/2] via 2.0.0.2, 00:00:24, vlan3
According to the routing table, Device1 has learnt routes 100.1.0.0/24 and 100.2.0.0/24 advertised by Device3.
Step 4: Configure BGP.
#Configure Device1.
Device1(config)#router bgp 100
Device1(config-bgp)#neighbor 1.0.0.2 remote-as 200
Device1(config-bgp)#exit
|
#Configure Device2.
Device2#configure terminal
Device2(config)#router bgp 200
Device2(config-bgp)#neighbor 1.0.0.1 remote-as 100
Device2(config-bgp)#exit
|
#On Device1, check the BGP neighbor status.
Device1#show ip bgp summary
BGP router identifier 1.0.0.1, local AS number 100 BGP table version is 2
1 BGP AS-PATH entries 0 BGP community entries
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.0.0.2 4 200 2 2 2 0 0 00:00:42 0
BGP neighbors have been successfully set up between Device1 and Device2.
Step 5: Configure BGP route summary.
Two solutions are available to satisfy network requirements.
Solution 1: Configure an aggregated static route that is targeted at null0 to introduce the aggregated static route to BGP.
#Configure Device1.
Device1(config)#ip route 100.0.0.0 255.252.0.0 null0
Device1(config)#router bgp 100
Device1(config-bgp)#network 100.0.0.0 255.252.0.0
Device1(config-bgp)#exit
|
Check the result.
#Query the BGP routing table of Device1.
Device1#show ip bgp
BGP table version is 2, local router ID is 10.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
[B]*> 100.0.0.0/14 0.0.0.0 32768 i
The aggregated route 100.0.0.0/14 has been generated in the BGP routing table of Device1.
#Query the routing table of Device2.
Device2#show ip bgp
BGP table version is 3, local router ID is 20.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,
S Stale
Origin codes: i - IGP, e - EGP, ? incomplete
Network Next Hop Metric LocPrf Weight Path
[B]*> 100.0.0.0/14 1.0.0.1 0 0 100 i
Device2#show ip route bgp
Codes: C - Connected, L - Local, S - static, R - RIP, B - BGP, i-ISIS
U - Per-user Static route
O - OSPF, OE-OSPF External, M - Management, E - IRMP, EX - IRMP external
B 100.0.0.0/14 [20/0] via 1.0.0.1, 01:39:30, vlan2
Device2 has successfully learnt the aggregated route 100.0.0.0/14 that has been advertised by Device1.
Solution 2: First introduce common routes into BGP, and then run the aggregate-address command to aggregate the routes.
#Configure Device1.
Device1(config)#router bgp 100
Device1(config-bgp)#redistribute ospf 100
Device1(config-bgp)#aggregate-address 100.0.0.0 255.252.0.0 summary-only
Device1(config-bgp)#exit
|
Check the result.
#Query the BGP routing table of Device1.
Device1#show ip bgp
BGP table version is 2, local router ID is 10.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,
S Stale
Origin codes: i - IGP, e - EGP, ? incomplete
Network Next Hop Metric LocPrf Weight Path
[B]*> 100.0.0.0/14 0.0.0.0 32768 i
[B]s> 100.1.0.0/24 2.0.0.2 2 32768 i
[B]s> 100.2.0.0/24 2.0.0.2 2 32768 i
The aggregated route 100.0.0.0/14 has been generated in the BGP routing table of Device1.
#Query the routing table of Device2.
Device2#show ip bgp
BGP table version is 3, local router ID is 20.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,
S Stale
Origin codes: i - IGP, e - EGP, ? incomplete
Network Next Hop Metric LocPrf Weight Path
[B]*> 100.0.0.0/14 1.0.0.1 0 0 100 i
Device2#show ip route bgp
Codes: C - Connected, L - Local, S - static, R - RIP, B BGP, i-ISIS
U Per-user Static route
O - OSPF, OE-OSPF External, M - Management, E - IRMP, EX IRMP external
B 100.0.0.0/14 [20/0] via 1.0.0.1, 01:39:30, vlan2
Device2 has successfully learnt the aggregated route 100.0.0.0/14 that has been advertised by Device1.
-
When the aggregate-address command is used to aggregate routes, if the extended command is configured, the device advertises only the aggregated route; otherwise, both common routes and aggregated routes are advertised.