Lab Objective:
The focus of this lab is to understand BGP implementation and configuration in Cisco IOS routers. Additional technologies tested include route reflection and path control.
Lab Topology:
The lab network topology is illustrated below:
|
IMPORTANT NOTE If you are using the www.howtonetwork.net racks, please bring up the LAN interfaces connected to the routers by issuing the no shutdown command on the connected switches. If you are using a home lab with no interface fastethernet 0/0 Alternately, you can simply connect the interfaces to a hub or switch if you have one available in your own lab. |
Task 1
Configure hostnames and IP addressing on all routers as illustrated in the network topology.
Task 2
Configure the following Loopback 0 interfaces on all routers:
R1 – Loopback 0: IP Address 1.1.1.1/32
R2 – Loopback 0: IP Address 2.2.2.2/32
R3 – Loopback 0: IP Address 3.3.3.3/32
R4 – Loopback 0: IP Address 4.4.4.4/32
Next, configure EIGRP, using AS 254, on all routers and enable EIGRP for all interfaces EXCEPT for the 150.x.x.x/24 LAN subnets connected to R1, R2, R3, and R4. Verify your configuration.
Task 3
Configure internal BGP on R1, R2, R3, and R4 shown below. Use peer-group configuration on R2 and R4 but NOT on R1 and R3:
- All routers should use their Loopback 0 interface addresses as their router IDs
- All routers should peer using their Loopback 0 interface addresses
- R1 and R3 should be configured as Route Reflectors
- R2 should peer with R1 and R3
- R4 should peer with R1 and R3
- R1 and R3 belong to the same cluster to reduce the size of the RIB
- All routers should use TCP MD5 authentication with a password of ‘CCNP’
- BGP Hellos should be sent every 5 seconds and the Hold Time should be set to 15 seconds
Verify your configuration using the appropriate commands.
Task 4
Advertise the 150.x.x.x/24 subnets on all routers via BGP. These prefixes should be redistributed into BGP on every router. In the future, there will be external BGP connections to one or more ISPs. Management has decided that the 150.x.x.x/24 subnets should never be advertised to these ISPs. Ensure that these prefixes are NEVER advertised out of AS 254. You are NOT allowed to use prefix lists or any type of filters. Verify your configuration using the appropriate commands. Verify that each router can also ping every other routers’ 150.x.x.x/24 LAN subnet.
Task 5
Ensure that R2 and R4 always prefer routes received from R3 to those received from R1 for each others’ 150.x.x.x/24 prefixes. You are only allowed to configure ONE router. Your solution should be globally significant; however, you are NOT allowed to modify any of the BGP default administrative distance values. You can modify BGP attributes as you see fit. Verify the configuration using the appropriate commands.
Lab Validation
Task 1
Please refer to previous labs for basic IP addressing and hostname configuration. This will not be included in this section to avoid being redundant.
Task 2
Please refer to previous labs for basic EIGRP configuration. This will not be included in this section to avoid being redundant. Following completion, the routing tables on your routers should show the following EIGRP route entries:
| R1#show ip route eigrp 2.0.0.0/32 is subnetted, 1 subnets D 2.2.2.2 [90/2297856] via 10.0.0.2, 00:01:21, Serial0/0 3.0.0.0/32 is subnetted, 1 subnets D 3.3.3.3 [90/2297856] via 10.0.0.6, 00:00:46, Serial0/1 4.0.0.0/32 is subnetted, 1 subnets D 4.4.4.4 [90/21152000] via 10.0.0.6, 00:00:15, Serial0/1 10.0.0.0/30 is subnetted, 3 subnets D 10.0.0.12 [90/21024000] via 10.0.0.6, 00:01:01, Serial0/1 |
| R2#show ip route eigrp 1.0.0.0/32 is subnetted, 1 subnets D 1.1.1.1 [90/2297856] via 10.0.0.1, 00:01:42, Serial0/0 3.0.0.0/32 is subnetted, 1 subnets D 3.3.3.3 [90/2809856] via 10.0.0.1, 00:01:00, Serial0/0 4.0.0.0/32 is subnetted, 1 subnets D 4.4.4.4 [90/21664000] via 10.0.0.1, 00:00:30, Serial0/0 10.0.0.0/30 is subnetted, 3 subnets D 10.0.0.12 [90/21536000] via 10.0.0.1, 00:01:15, Serial0/0 D 10.0.0.4 [90/2681856] via 10.0.0.1, 00:01:42, Serial0/0 |
| R3#show ip route eigrp 1.0.0.0/32 is subnetted, 1 subnets D 1.1.1.1 [90/20640000] via 10.0.0.5, 00:01:34, Serial1/0 2.0.0.0/32 is subnetted, 1 subnets D 2.2.2.2 [90/21152000] via 10.0.0.5, 00:01:34, Serial1/0 4.0.0.0/32 is subnetted, 1 subnets D 4.4.4.4 [90/20640000] via 10.0.0.14, 00:00:44, Serial1/2 10.0.0.0/30 is subnetted, 3 subnets D 10.0.0.0 [90/21024000] via 10.0.0.5, 00:01:34, Serial1/0 |
| R4#show ip route eigrp 1.0.0.0/32 is subnetted, 1 subnets D 1.1.1.1 [90/21152000] via 10.0.0.13, 00:01:06, Serial0/0 2.0.0.0/32 is subnetted, 1 subnets D 2.2.2.2 [90/21664000] via 10.0.0.13, 00:01:06, Serial0/0 3.0.0.0/32 is subnetted, 1 subnets D 3.3.3.3 [90/2297856] via 10.0.0.13, 00:01:06, Serial0/0 10.0.0.0/30 is subnetted, 3 subnets D 10.0.0.0 [90/21536000] via 10.0.0.13, 00:01:06, Serial0/0 D 10.0.0.4 [90/21024000] via 10.0.0.13, 00:01:06, Serial0/0 |
Task 3
This task is straightforward. By default, the BGP RID will be derived from the highest address of all physical interfaces or the highest address of all Loopback interfaces. Given that the Loopback0 interfaces are configured on all routers, there is NO need to manually configure the RID using the bgp router-id <address> command.
Additionally, when configuring the route reflectors, it is important to understand that they do not need to be clients of each other. Instead, in environments where there are multiple route reflectors being used for redundancy, you should configure route reflectors in the same cluster, i.e. serving the same clients, using the bgp cluster-id <cluster ID> command. This prevents multiple entries in the BGP Table because the route reflectors recognize updates from each other based on the CLUSTER_LIST attribute. The CLUSTER_LIST attribute is an optional, non-transitive BGP attribute of Type Code 10.
It is a sequence of CLUSTER_ID values representing the route reflection path that the prefix has traversed. When the RR reflects a route, it must prepend the local CLUSTER_ID to the CLUSTER_LIST. If the UPDATE has an empty CLUSTER_LIST, the RR must create a new one. Like the ORIGINATOR_ID attribute, the CLUSTER_LIST attribute is also used for to prevent loops in iBGP implementations.
Finally, remember that when you are configuring multiple BGP peers, you can also configure peer groups to minimize the number of commands that are issued. Both the long version and peer group configuration are illustrated in this example. You may use either method to complete this task. In this example, the task is completed using both of the methods as follows:
| R1(config)#router bgp 254 R1(config-router)#bgp cluster-id 55.55.55.55 R1(config-router)#neighbor 2.2.2.2 remote-as 254 R1(config-router)#neighbor 2.2.2.2 update-source loopback 0 R1(config-router)#neighbor 2.2.2.2 route-reflector-client R1(config-router)#neighbor 2.2.2.2 password CCNP R1(config-router)#neighbor 2.2.2.2 timers 5 15 % Warning: A hold time of less than 20 seconds increases the chances of peer flapping R1(config-router)#neighbor 3.3.3.3 remote-as 254 R1(config-router)#neighbor 3.3.3.3 update-source loopback 0 R1(config-router)#neighbor 3.3.3.3 password CCNP R1(config-router)#neighbor 3.3.3.3 timers 5 15 % Warning: A hold time of less than 20 seconds increases the chances of peer flapping R1(config-router)#neighbor 4.4.4.4 remote-as 254 R1(config-router)#neighbor 4.4.4.4 update-source loopback 0 R1(config-router)#neighbor 4.4.4.4 route-reflector-client R1(config-router)#neighbor 4.4.4.4 password CCNP R1(config-router)#neighbor 4.4.4.4 timers 5 15 % Warning: A hold time of less than 20 seconds increases the chances of peer flapping R1(config-router)#exit |
| R2(config)#router bgp 254 R2(config-router)#neighbor INTERNAL peer-group R2(config-router)#neighbor INTERNAL remote-as 254 R2(config-router)#neighbor INTERNAL update-source loopback 0 R2(config-router)#neighbor INTERNAL password CCNP R2(config-router)#neighbor INTERNAL timers 5 15 % Warning: A hold time of less than 20 seconds increases the chances of peer flapping R2(config-router)#neighbor 1.1.1.1 peer-group INTERNAL R2(config-router)#neighbor 3.3.3.3 peer-group INTERNAL R2(config-router)#exit |
| R3(config)#router bgp 254 R3(config-router)#bgp cluster-id 55.55.55.55 R3(config-router)#neighbor 1.1.1.1 remote-as 254 R3(config-router)#neighbor 1.1.1.1 update-source loopback 0 R3(config-router)#neighbor 1.1.1.1 password CCNP R3(config-router)#neighbor 1.1.1.1 timers 5 15 % Warning: A hold time of less than 20 seconds increases the chances of peer flapping R3(config-router)#neighbor 2.2.2.2 remote-as 254 R3(config-router)#neighbor 2.2.2.2 update-source loopback 0 R3(config-router)#neighbor 2.2.2.2 password CCNP R3(config-router)#neighbor 2.2.2.2 timers 5 15 % Warning: A hold time of less than 20 seconds increases the chances of peer flapping R3(config-router)#neighbor 2.2.2.2 route-reflector-client R3(config-router)#neighbor 3.3.3.3 remote-as 254 % Cannot configure the local system as neighbor R3(config-router)#neighbor 4.4.4.4 remote-as 254 R3(config-router)#neighbor 4.4.4.4 update-source loopback 0 R3(config-router)#neighbor 4.4.4.4 password CCNP R3(config-router)#neighbor 4.4.4.4 timers 5 15 % Warning: A hold time of less than 20 seconds increases the chances of peer flapping R3(config-router)#neighbor 4.4.4.4 route-reflector-client R3(config-router)#exit |
| R4(config)#router bgp 254 R4(config-router)#neighbor INTERNAL peer-group R4(config-router)#neighbor INTERNAL update-source loopback 0 R4(config-router)#neighbor INTERNAL remote-as 254 R4(config-router)#neighbor INTERNAL timers 5 15 % Warning: A hold time of less than 20 seconds increases the chances of peer flapping R4(config-router)#neighbor INTERNAL password CCNP R4(config-router)#neighbor 1.1.1.1 peer-group INTERNAL R4(config-router)#neighbor 3.3.3.3 peer-group INTERNAL R4(config-router)#exit |
Verify your configuration using the show ip bgp summary command:
| R1#show ip bgp summary BGP router identifier 1.1.1.1, local AS number 254 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd |
| R2#show ip bgp summary BGP router identifier 2.2.2.2, local AS number 254 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd |
| R3#show ip bgp summary BGP router identifier 3.3.3.3, local AS number 254 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd |
| R4#show ip bgp summary BGP router identifier 4.4.4.4, local AS number 254 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd |
Task 4
To complete this task, you need to use the COMMUNITY attribute. This attribute, Attribute Type Code 8, is an optional transitive attribute that is used to group destinations, called communities. Once the destination prefixes have been grouped, routing decisions, such as acceptance, preference, and redistribution, can be applied. Cisco IOS route maps are to set the community attribute.
Well-known communities are communities that have predefined meanings. Cisco IOS software supports four well-known communities which are NO_EXPORT, NO_ADVERTISE, INTERNET, and LOCAL_AS. The NO_EXPORT well-known community prevents BGP prefixes that are specifically assigned this predefined community attribute value from being advertised to any eBGP peers. The prefixes, however, will continue to be advertised to all other BGP speakers within the local AS. In other words, prefixes assigned this community value will remain local to the Autonomous System (AS).
The NO_ADVERTISE community prevents any prefixes that are assigned this predefined community attribute from being advertised to any peer – internal or external. The INTERNET community allows all prefixes assigned to this community to be advertised to any and all BGP peers (assuming no filtering, etc, is in place). In Cisco IOS software, all BGP prefixes belong to the INTERNET community by default.
And finally, the LOCAL_AS community is used in a somewhat similar manner to another of the previously described communities: the NO_EXPORT community. If used in a Confederation, the LOCAL_AS community prevents all prefixes assigned this community from being advertised out of the local sub autonomous system. When Confederations are not implemented, the LOCAL_AS community is applied in the same manner as the NO_EXPORT community.
To complete this task, use either the LOCAL_AS or NO_EXPORT communities. In order to use the COMMUNITY attribute, you need to configure theneighbor <address> send-community command for all peers. This task is completed as follows:
| R1(config)#route-map CONNECTED permit 10 R1(config-route-map)#match interface fastethernet 0/0 R1(config-route-map)#set community local-as R1(config-route-map)#exit R1(config)#route-map CONNECTED deny 20 R1(config-route-map)#exit R1(config)#router bgp 254 R1(config-router)#redistribute connected route-map CONNECTED R1(config-router)#neighbor 2.2.2.2 send-community standard R1(config-router)#neighbor 3.3.3.3 send-community standard R1(config-router)#neighbor 4.4.4.4 send-community standard |
| R2(config)#route-map CONNECTED permit 10 R2(config-route-map)#match interface fastethernet 0/0 R2(config-route-map)#set community local-as R2(config-route-map)#exit R2(config)#route-map CONNECTED deny 20 R2(config-route-map)#exit R2(config)#router bgp 254 R2(config-router)#redistribute connected route-map CONNECTED R2(config-router)#neighbor INTERNAL send-community standard R2(config-router)#exit |
| R3(config-router)#route-map CONNECTED permit 10 R3(config-route-map)#match interface fastethernet 0/0 R3(config-route-map)#set community local-as R3(config-route-map)#exit R3(config)#route-map CONNECTED deny 20 R3(config-route-map)#exit R3(config)#router bgp 254 R3(config-router)#redistribute connected route-map CONNECTED R3(config-router)#neighbor 1.1.1.1 send-community standard R3(config-router)#neighbor 2.2.2.2 send-community standard R3(config-router)#neighbor 4.4.4.4 send-community standard |
| R4(config)#route-map CONNECTED permit 10 R4(config-route-map)#match interface fastethernet 0/0 R4(config-route-map)#set community local-as R4(config-route-map)#exit R4(config)#route-map CONNECTED deny 20 R4(config-route-map)#exit R4(config)#router bgp 254 R4(config-router)#redistribute connected route-map CONNECTED R4(config-router)#neighbor INTERNAL send-community standard R4(config-router)#exit |
Following this configuration, verify your configuration using the show ip bgp command:
| R1#show ip bgp 150.1.1.0 255.255.255.0 BGP routing table entry for 150.1.1.0/24, version 2 Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS) Advertised to update-groups: 1 2 Local 0.0.0.0 from 0.0.0.0 (1.1.1.1) Origin incomplete, metric 0, localpref 100, weight 32768, valid, sourced, best Community: local-AS |
| R2#show ip bgp 150.2.2.0 255.255.255.0 BGP routing table entry for 150.2.2.0/24, version 3 Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS) Flag: 0x820 Advertised to update-groups: 1 Local 0.0.0.0 from 0.0.0.0 (2.2.2.2) Origin incomplete, metric 0, localpref 100, weight 32768, valid, sourced, best Community: local-AS |
| R3#show ip bgp 150.3.3.0 255.255.255.0 BGP routing table entry for 150.3.3.0/24, version 4 Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS) Advertised to update-groups: 1 2 Local 0.0.0.0 from 0.0.0.0 (3.3.3.3) Origin incomplete, metric 0, localpref 100, weight 32768, valid, sourced, best Community: local-AS |
| R4#show ip bgp 150.4.4.0 255.255.255.0 BGP routing table entry for 150.4.4.0/24, version 6 Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS) Flag: 0x820 Advertised to update-groups: 1 Local 0.0.0.0 from 0.0.0.0 (4.4.4.4) Origin incomplete, metric 0, localpref 100, weight 32768, valid, sourced, best Community: local-AS |
You can verify that the COMMUNITY attribute is being sent to peers using the show ip bgp neighbors <address> command:
| R1#show ip bgp neighbors 2.2.2.2 BGP neighbor is 2.2.2.2, remote AS 254, internal link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:34:11 Last read 00:00:00, last write 00:00:00, hold time is 15, keepalive interval is 5 seconds Configured hold time is 15,keepalive interval is 5 seconds Minimum holdtime from neighbor is 0 seconds Neighbor capabilities: Route refresh: advertised and received(old & new) Address family IPv4 Unicast: advertised and received Message statistics: InQ depth is 0 OutQ depth is 0 Sent Rcvd Opens: 1 1 Notifications: 0 0 Updates: 5 1 Keepalives: 413 413 Route Refresh: 0 0 Total: 419 415 Default minimum time between advertisement runs is 0 seconds For address family: IPv4 Unicast Outbound Inbound |
Task 5
Prior to any configuration changes, the BGP tables on R2 and R4 show the following entries for each others’ 150.x.x.x/24 subnets:
| R2#show ip bgp 150.4.4.0 255.255.255.0 BGP routing table entry for 150.4.4.0/24, version 13 Paths: (2 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS) Not advertised to any peer Local 4.4.4.4 (metric 21664000) from 1.1.1.1 (1.1.1.1) Origin incomplete, metric 0, localpref 100, valid, internal, best Community: local-AS Originator: 4.4.4.4, Cluster list: 55.55.55.55 Local 4.4.4.4 (metric 21664000) from 3.3.3.3 (3.3.3.3) Origin incomplete, metric 0, localpref 100, valid, internal Community: local-AS Originator: 4.4.4.4, Cluster list: 55.55.55.55 |
| R4#show ip bgp 150.2.2.0 255.255.255.0 BGP routing table entry for 150.2.2.0/24, version 11 Paths: (2 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS) Not advertised to any peer Local 2.2.2.2 (metric 21664000) from 1.1.1.1 (1.1.1.1) Origin incomplete, metric 0, localpref 100, valid, internal, best Community: local-AS Originator: 2.2.2.2, Cluster list: 55.55.55.55 Local 2.2.2.2 (metric 21664000) from 3.3.3.3 (3.3.3.3) Origin incomplete, metric 0, localpref 100, valid, internal Community: local-AS Originator: 2.2.2.2, Cluster list: 55.55.55.55 |
Given that all else is equal, the route received from R1 is preferred because it is comes from the lowest neighbor address. To complete this task, it is most simple to use LOCAL_PREF:
| R3(config-router)#route-map LOCAL-PREF permit 10 R3(config-route-map)#set local-preference 200 R3(config)#router bgp 254 R3(config-router)#neighbor 2.2.2.2 route-map LOCAL-PREF in R3(config-router)#neighbor 4.4.4.4 route-map LOCAL-PREF in R3(config-router)#exit |
Following this change, the BGP RIBs show the following for the LAN subnets:
| R2#show ip bgp 150.4.4.0 255.255.255.0 BGP routing table entry for 150.4.4.0/24, version 20 Paths: (2 available, best #2, table Default-IP-Routing-Table, not advertised outside local AS) Flag: 0x800 Not advertised to any peer Local 4.4.4.4 (metric 21664000) from 1.1.1.1 (1.1.1.1) Origin incomplete, metric 0, localpref 100, valid, internal Community: local-AS Originator: 4.4.4.4, Cluster list: 55.55.55.55 Local 4.4.4.4 (metric 21664000) from 3.3.3.3 (3.3.3.3) Origin incomplete, metric 0, localpref 200, valid, internal, best Community: local-AS Originator: 4.4.4.4, Cluster list: 55.55.55.55 |
| R4#show ip bgp 150.2.2.0 255.255.255.0 BGP routing table entry for 150.2.2.0/24, version 17 Paths: (2 available, best #2, table Default-IP-Routing-Table, not advertised outside local AS) Flag: 0x800 Not advertised to any peer Local 2.2.2.2 (metric 21664000) from 1.1.1.1 (1.1.1.1) Origin incomplete, metric 0, localpref 100, valid, internal Community: local-AS Originator: 2.2.2.2, Cluster list: 55.55.55.55 Local 2.2.2.2 (metric 21664000) from 3.3.3.3 (3.3.3.3) Origin incomplete, metric 0, localpref 200, valid, internal, best Community: local-AS Originator: 2.2.2.2, Cluster list: 55.55.55.55 |
NOTE: Setting the route map INBOUND allows the R3 to essentially ‘re-set’ the LOCAL_PREF of all received prefixes to the specified value. Because LOCAL_PREF is included in updates to iBGP peers, this value is propagated to all other routers in the domain. If you sent LOCAL_PREF in the outbound direction, this is applicable only to routes originated by and advertised by R3. In other words, it would only apply to the 150.3.3.0/24 prefix. Again, it is very important to understand the direction in which attributes are applied.
Final Router Configurations
R1
|
R1#term len 0 Current configuration : 1855 bytes R1# |
R2
|
R2#term len 0 Current configuration : 1460 bytes R2# |
R3
|
R3#term len 0 Current configuration : 2319 bytes R3# |
R4
|
R4#term len 0 Current configuration : 1462 bytes R4# |
