Lab Objective:
The focus of this lab is to understand BGP implementation and configuration in Cisco IOS routers. Additional technologies include route filtering 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 BGP as illustrated in the topology. R1 will peer with R2. R2 will peer with R1 and R3. R3 will peer with R4. Do NOT peer R1 and R4 even though they exist in the same AS. Verify the configuration using the appropriate commands.
Task 3
Advertise the 150.2.2.0/24 and 150.3.3.0/24 prefixes connected to R2 and R3, respectively, using BGP. Do NOT advertise the 150.1.1.0/24 subnet connected to R1 and R4. However, ensure that both R2 and R3 can still ping this subnet. You are NOT allowed to use static routes. Verify your configuration using an extended ping from the LAN subnets connected to R2 and R3 to the 150.1.1.0/24 subnet connected to R1 and R4.
Task 4
Configure BGP so that R3 prefers the path via R2 to reach the 150.1.1.0/24 subnet. You are only allowed to configure a device in AS 1. You are NOT allowed to advertise the 150.1.1.0/24 prefix when completing this task. Verify your configuration and ensure that R2 and R3 can still ping the 150.1.1.1/24 and 150.1.1.4/24 addresses when complete. Use an extended ping that is sourced from R3s LAN IP address.
Task 5
Configure OSPF on the LAN subnet between R1 and R4. Next, configure AS 1 so that R4 will prefer the path via R1 to reach the 150.2.2.0/24 or 150.3.3.0/24 subnets. In the event that the WAN link between R1 and R2 is down, the path via R4 should be used instead. You are NOT allowed to establish an iBGP neighbor relationship between R1 and R4 to complete this task. Additionally, you are not allowed to use the distance command to modify any protocol administrative distance values. Instead, use a BGP feature when completing this task. Verify your configuration using the appropriate commands. Ensure R4 can still ping the 150.2.2.0/24 and the 150.3.3.0/24 subnets when complete.
HINT: Use the BGP network command to complete this task.
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
| R1(config)#router bgp 1 R1(config-router)#bgp router-id 1.1.1.1 R1(config-router)#neighbor 10.0.0.2 remote-as 2 R1(config-router)#exit |
| R2(config)#router bgp 2 R2(config-router)#bgp router-id 2.2.2.2 R2(config-router)#neighbor 10.0.0.1 remote-as 1 R2(config-router)#neighbor 10.0.0.10 remote-as 3 R2(config-router)#exit |
| R3(config)#router bgp 3 R3(config-router)#bgp router-id 3.3.3.3 R3(config-router)#neighbor 10.0.0.9 remote-as 2 R3(config-router)#neighbor 10.0.0.14 remote-as 1 R3(config-router)#exit |
| R4(config)#router bgp 1 R4(config-router)#bgp router-id 4.4.4.4 R4(config-router)#neighbor 10.0.0.13 remote-as 3 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 1 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 2 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 3 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 1 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd |
Task 3
To complete this task, you need to configure R1 and R4 to advertise defaults to R2 and R3:
| R2(config)#router bgp 2 R2(config-router)#network 150.2.2.0 mask 255.255.255.0 R2(config-router)#exit |
| R3(config)#router bgp 3 R3(config-router)#network 150.3.3.0 mask 255.255.255.0 R3(config-router)#exit |
| R1(config)#router bgp 1 R1(config-router)#neighbor 10.0.0.2 default-originate R1(config-router)#exit |
| R4(config)#router bgp 1 R4(config-router)#neighbor 10.0.0.13 default-originate R4(config-router)#exit |
Next, verify your configuration using the show ip bgp command:
| R1#show ip bgp BGP table version is 3, local router ID is 1.1.1.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 |
| R2#show ip bgp BGP table version is 4, local router ID is 2.2.2.2 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 |
| R3#show ip bgp BGP table version is 5, local router ID is 3.3.3.3 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 |
| R4#show ip bgp BGP table version is 3, local router ID is 4.4.4.4 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 |
Finally, verify that R2 and R3 can ping the 150.1.1.1/24 and 150.1.1.4/24 addresses from their respective LAN addresses using an extended ping:
| R2#ping 150.1.1.1 source fastethernet 0/0 repeat 10
Type escape sequence to abort. R2#ping 150.1.1.4 source fastethernet 0/0 repeat 10 Type escape sequence to abort. |
| R3#ping 150.1.1.1 source fastethernet 0/0 repeat 10
Type escape sequence to abort. R3#ping 150.1.1.4 source fastethernet 0/0 repeat 10 Type escape sequence to abort. |
Task 4
To complete this task, you need to use a route map and AS_PATH prepending to make the default route advertised by R4 longer than that advertised by R1. This route-map should be applied to the default route advertised to R3. This task is completed as follows:
| R4(config)#route-map PREPEND permit 10 R4(config-route-map)#set as-path prepend 1 1 1 1 R4(config-route-map)#exit R4(config)#router bgp 1 R4(config-router)#neighbor 10.0.0.13 default-originate route-map PREPEND R4(config-router)#exit |
Following this change, verify the BGP Table on R3 to ensure the preferred default is via R2:
| R3#show ip bgp BGP table version is 6, local router ID is 3.3.3.3 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 |
Finally, verify that R3 can still ping the 150.1.1.1/24 and 150.1.1.4/24 addresses after the change:
| R3#ping 150.1.1.1 source fastethernet 0/0 repeat 10
Type escape sequence to abort. R3#ping 150.1.1.4 source fastethernet 0/0 repeat 10 Type escape sequence to abort. |
Task 5
The requirements of this task are threefold. First, you need to enable OSPF between R1 and R4 across their directly connected LAN segment. Following this configuration, verify the OSPF adjacency between the routers using the show ip ospf neighbor command. You can refer to previous labs for OSPF configuration basics.
| R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface |
| R4#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface |
The second part of this task entails redistribution between OSPF and BGP. This allows the LAN subnets connected to R2 and R4 to be advertised across the LAN link connecting R1 and R2. You do NOT need to redistribute OSPF routes into BGP, otherwise you will advertise the LAN subnet between R1 and R4, which is NOT permitted as stated in previous tasks:
| R1(config)#router ospf 1 R1(config-router)#redistribute bgp 1 subnets R1(config-router)#exit |
| R4(config)#router ospf 4 R4(config-router)#redistribute bgp 1 subnets R4(config-router)#exit |
Following this configuration, verify that the routing tables on both routers show all routes:
| R1#show 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 10.0.0.0/30 is subnetted, 1 subnets |
| R4#show 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 10.0.0.0/30 is subnetted, 1 subnets |
As illustrated in the output above, both routers prefer the BGP routes because of the lower administrative distance of external BGP (20) versus OSPF (110). To complete this task, use the hint provided in the lab, which states that you should use the BGP network command.
The correct command to use in this case would be network <address> <mask> backdoor command. The backdoor keyword configures the router to change the administrative distance of the specified external BGP route from 20 to 200. This allows IGP routes to be preferred instead. When the IGP routes are no longer present in the routing table, the BGP route is again used. This task is completed as follows:
| R4(config)#router bgp 1 R4(config-router)#network 150.2.2.0 mask 255.255.255.0 backdoor R4(config-router)#network 150.3.3.0 mask 255.255.255.0 backdoor R4(config-router)#exit |
Following this change, the routing table on R4 shows the following route entries:
| R4#show 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 10.0.0.0/30 is subnetted, 1 subnets |
Next, complete this task by ensuring that R4 can still ping the 150.2.2.0/24 and the 150.3.3.0/24 subnets when complete. Because the routes are known via the FastEthernet0/0 interface, you do NOT need to use an extended ping as the ping will be sourced from the egress interface:
| R4#ping 150.2.2.2 repeat 10
Type escape sequence to abort. R4#ping 150.3.3.3 repeat 10 Type escape sequence to abort. |
Finally, verify redundancy by shutting down the R1-R2 link and ensuring that R1 can still reach the 150.2.2.0/24 and 150.3.3.0/24 subnets. This is completed as follows:
| R1(config)#interface serial 0/0 R1(config-if)#shutdown R1(config-if)#exit R1(config)#do show 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 150.1.0.0/24 is subnetted, 1 subnets Type escape sequence to abort. Type escape sequence to abort. |
Final Router Configurations
R1
|
R1#term len 0 Current configuration : 1135 bytes R1# |
R2
|
R2#term len 0 Current configuration : 1006 bytes R2# |
R3
|
R3#term len 0 Current configuration : 1347 bytes R3# |
R4
|
R4#term len 0 Current configuration : 1239 bytes R4# |
