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 R2. Verify the configuration using the appropriate commands.
Task 3
Configure R2 and R3 to advertise their 150.2.2.0/24 and 150.3.3.0/24 prefixes via BGP. Do NOT advertise the 150.1.1.0/24 subnet via BGP; however, ensure that both R2 and R3 can ping R1s LAN IP address. They do NOT need to be able to ping the LAN address of R4. Finally, verify your configuration using the appropriate commands and as Cisco IOS extended ping functions.
Task 4
Management has decided that they would like BGP neighbor relationship between R1 and R3. This should transit R4. Configure a BGP peer relationship between R1s Fa0/0 interface and R3s Se1/2 interface. You are NOT allowed to enable an IGP on R1, R3 or R4; you are NOT allowed to configure BGP or static routing on R4; however, you are allowed to configure a single /32 host route on both R1 and R3. Ensure that when the R1-R2 WAN link is up, R1 prefers the path via R2 to reach the 150.2.2.0/24 and 150.3.3.0/24 prefixes. YOU are NOT allowed to use route maps as part of your solution. Verify your configuration using the appropriate commands.
Task 5
Configure your network so that when the R1-R2 link is down, R1s LAN address can still reach the 150.2.2.0/24 and 150.3.3.0/24 subnets and vice-versa. You are NOT allowed to configure static routes or an IGP on R1, R3, or R4. Do NOT configure BGP on R4. You can NOT use PBR on any routers, or create a tunnel between R1 and R3. And finally, do NOT advertise the 150.1.1.0/24 prefix via BGP. Your solution should ensure that when the R1-R2 link is up, R3 will use the path via R2 to reach the 150.1.1.0/24 subnet.
When complete, verify your configuration by shutting down the R1-R2 WAN link. After this, verify that R1s LAN interface can ping both the 150.2.2.0/24 and 150.3.3.0/24 subnets and vice-versa. All your pings should be successful.
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 10 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)#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 |
Task 3
The requirements of this task are three-fold. First, simply advertise the LAN subnets connected to R2 and R3 using the network command. Second, to allow R2 and R3 to ping the LAN interface address of R1, configure R1 to advertise a default route to R2, which will then advertise it to R3. The first two steps of this task are completed on R1, R2, and R3 as follows:
| R1(config)#router bgp 1 R1(config-router)#neighbor 10.0.0.2 default-originate R1(config-router)#exit |
| 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 |
Verify your configuration using the show ip bgp command on all three routers:
| 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 4, 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 your configuration using extended pings between R1, R2, and R3:
| R1#ping 150.2.2.2 source fastethernet 0/0 repeat 10
Type escape sequence to abort. R1#ping 150.3.3.3 source fastethernet 0/0 repeat 10 Type escape sequence to abort. |
| R2#ping 150.1.1.1 source fastethernet 0/0 repeat 10
Type escape sequence to abort. R2#ping 150.3.3.3 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.2.2.2 source fastethernet 0/0 repeat 10 Type escape sequence to abort. |
Task 4
The requirements of this task are two-fold. The first is that you need to enable BGP between R1 and R3. This should be done across R4 and is completed using two static routes, one on R1 and the other on R3 to establish an external BGP adjacency. This task is completed as follows:
| R1(config)#router bgp 1 R1(config-router)#neighbor 10.0.0.13 remote-as 3 R1(config-router)#neighbor 10.0.0.13 update-source fastethernet 0/0 R1(config-router)#neighbor 10.0.0.13 ebgp-multihop R1(config-router)#exit |
| R3(config)#router bgp 3 R3(config-router)#neighbor 150.1.1.1 remote-as 1 R3(config-router)#neighbor 150.1.1.1 ebgp-multihop R3(config-router)#neighbor 150.1.1.1 update-source serial 1/2 R3(config-router)#exit |
Verify your configuration using the show ip bgp summary command on R1 and R3:
| R1#show ip bgp summary BGP router identifier 1.1.1.1, local AS number 1 BGP table version is 4, main routing table version 4 2 network entries using 234 bytes of memory 4 path entries using 208 bytes of memory 5/2 BGP path/bestpath attribute entries using 620 bytes of memory 4 BGP AS-PATH entries using 96 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 BGP using 1158 total bytes of memory BGP activity 2/0 prefixes, 4/0 paths, scan interval 60 secs 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 7, main routing table version 7 3 network entries using 351 bytes of memory 4 path entries using 208 bytes of memory 6/3 BGP path/bestpath attribute entries using 744 bytes of memory 4 BGP AS-PATH entries using 96 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 BGP using 1399 total bytes of memory BGP activity 3/0 prefixes, 7/3 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd |
The second requirement is that R1 should prefer the path via R2 to reach the 150.2.2.0/24 prefix as well as the 150.3.3.0/24 prefix. By default, R1 will prefer the path via R2 to reach the 150.2.2.0/24 prefix because of the shorter AS_PATH. However, now that an external BGP peer session has been established between R1 and R3, R1 will prefer the path via R3 to reach the 150.3.3.0/24 prefix. Prior to changes on R1, the BGP RIB entry for this prefix shows as follows:
| R1#show ip bgp 150.3.3.0 255.255.255.0 BGP routing table entry for 150.3.3.0/24, version 4 Paths: (2 available, best #1, table Default-IP-Routing-Table) Advertised to update-groups: 1 3 10.0.0.13 from 10.0.0.13 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, external, best 2 3 10.0.0.2 from 10.0.0.2 (2.2.2.2) Origin IGP, localpref 100, valid, external |
Because we cannot use route maps to set the LOCAL_PREF, we must instead use the neighbor <address> weight <value> command to assign all prefixes received via R1 a higher WEIGHT value. This will ensure that R1 prefers the path via R2 to reach the 150.3.3.0/24 prefix:
| R1(config)#router bgp 1 R1(config-router)#neighbor 10.0.0.2 weight 1 R1(config-router)#exit |
Following this change, R1 shows the following BGP Table entry for the 150.3.3.0/24 prefix:
| R1#show ip bgp 150.3.3.0 255.255.255.0 BGP routing table entry for 150.3.3.0/24, version 6 Paths: (2 available, best #2, table Default-IP-Routing-Table) Flag: 0x820 Advertised to update-groups: 2 3 10.0.0.13 from 10.0.0.13 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, external 2 3 10.0.0.2 from 10.0.0.2 (2.2.2.2) Origin IGP, localpref 100, weight 1, valid, external, best |
Task 5
This task requires a little bit of thought and has two core requirements. The first requirement is that router R2 and R3 should be able to reach the 150.1.1.0/24 when the R1-R2 link is down. This must be performed in such a manner that router R3 still prefers the path via R2 to reach the 150.1.1.0/24 subnet. Because routers will not compare MED values for prefixes received from different ASes, the AS_PATH attribute must be used instead. This part is completed as follows:
| R1(config)#route-map PREPEND permit 10 R1(config-route-map)#set as-path prepend 1 1 R1(config-route-map)#exit R1(config)#router bgp 1 R1(config-router)#neighbor 10.0.0.13 default-originate route-map PREPEND R1(config-router)#exit |
Following this change, the BGP Tables on R2 and R3 show the following for the default route:
| R2#show ip bgp 0.0.0.0 0.0.0.0 BGP routing table entry for 0.0.0.0/0, version 6 Paths: (1 available, best #1, table Default-IP-Routing-Table) Advertised to update-groups: 1 1 10.0.0.1 from 10.0.0.1 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, external, best |
| R3#show ip bgp 0.0.0.0 0.0.0.0 BGP routing table entry for 0.0.0.0/0, version 7 Paths: (2 available, best #2, table Default-IP-Routing-Table) Advertised to update-groups: 1 1 1 1 150.1.1.1 from 150.1.1.1 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, external 2 1 10.0.0.9 from 10.0.0.9 (2.2.2.2) Origin IGP, localpref 100, valid, external, best |
The second requirement, or part, of this task is that R1s LAN interface be able to ping the R2 and R3 LAN addresses and vice-versa. From a routing perspective, when the WAN link between R1 and R2 is shut down, the routes are received via R3. This is demonstrated below:
| R1(config)#interface serial 0/0 R1(config-if)#shutdown R1(config-if)#exit R1(config)#do show ip bgp BGP table version is 8, 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 |
The issue, however, exists on R4. This router is a transit router between R1 and R3; however, it has no routing information for the 150.2.2.0/24 or 150.3.3.0/24 prefixes. Therefore, when a ping from R1 is initiated to either of these subnets, it is dropped by R4 because this router has no routing information for the destination. This is demonstrated by initiating a ping to 150.2.2.2 from R1 while running the debug ip packet [detail] command on R4:
| R1#ping 150.2.2.2 source fastethernet 0/0 repeat 10
Type escape sequence to abort. |
The debug ip packet detail command output on R4 shows the following:
|
R4#debug ip pack detail IP packet debugging is on (detailed) R4# R4# R4# *May 12 19:49:29.067: IP: s=150.1.1.1 (FastEthernet0/0), d=150.2.2.2, len 100, unroutable *May 12 19:49:29.067: ICMP type=8, code=0 *May 12 19:49:29.067: IP: tableid=0, s=150.1.1.4 (local), d=150.1.1.1 (FastEthernet0/0), routed via FIB *May 12 19:49:29.067: IP: s=150.1.1.4 (local), d=150.1.1.1 (FastEthernet0/0), len 56, sending *May 12 19:49:29.067: ICMP type=3, code=1 *May 12 19:49:31.067: IP: s=150.1.1.1 (FastEthernet0/0), d=150.2.2.2, len 100, unroutable *May 12 19:49:31.067: ICMP type=8, code=0 *May 12 19:49:31.067: IP: tableid=0, s=150.1.1.4 (local), d=150.1.1.1 (FastEthernet0/0), routed via FIB *May 12 19:49:31.071: IP: s=150.1.1.4 (local), d=150.1.1.1 (FastEthernet0/0), len 56, sending *May 12 19:49:31.071: ICMP type=3, code=1 *May 12 19:49:33.071: IP: s=150.1.1.1 (FastEthernet0/0), d=150.2.2.2, len 100, unroutable *May 12 19:49:33.071: ICMP type=8, code=0 *May 12 19:49:33.071: IP: tableid=0, s=150.1.1.4 (local), d=150.1.1.1 (FastEthernet0/0), routed via FIB *May 12 19:49:33.075: IP: s=150.1.1.4 (local), d=150.1.1.1 (FastEthernet0/0), len 56, sending *May 12 19:49:33.075: ICMP type=3, code=1 [Truncated Output] |
The difficulty level of this task is further increased because we are not allowed to configure any additional static routes or enable a dynamic routing protocol on R1, R3, and R4. Additionally, the task requirements stipulate that we cannot use PBR or a tunnel to complete this task. With such stringent requirements, we must think outside the box and consider other Cisco IOS software features. In essence, based on the debug output, we know that all we need is routing information on R4 pointing to R3 for the 150.2.2.0/24 and 150.3.3.0/24 prefixes. While we cannot use static routes or enable a dynamic routing protocol, there is NO stipulation against using ODR. This is because ODR is NOT a routing protocol, but rather a CDP extension. Therefore, to complete this task, simply configure R3 to advertise a default route via ODR to R1.
Because R1 will automatically advertise the 150.1.1.0/24 prefix, we need to filter from R3 so that this path is NOT used to forward traffic to the 150.1.1.0/24 prefix when the R1-R2 link is up. This task is completed by implementing the following configuration on R3:
| R3(config)#access-list 1 deny any R3(config)#router odr R3(config-router)#distribute-list 1 in R3(config-router)#exit |
Following this configuration R3s routing table still shows only BGP routes:
| R3#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 150.1.1.1 to network 0.0.0.0 10.0.0.0/30 is subnetted, 2 subnets |
The same is also applicable to R2s routing table which only shows BGP routes:
| R2#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 10.0.0.10 to network 0.0.0.0 10.0.0.0/30 is subnetted, 1 subnets |
R4s routing table, however, now includes a default route received via ODR pointing to R3. This will allow R4 to forward packets sent from R1 destined to 150.2.2.0/24 and 150.3.3.0/24. There is no need to configure any static routes on R3 for R1s LAN IP address because a static route already exists and is pointing to R4. This is the static route used to establish the eBGP neighbor relationship with R1 that was configured earlier in this lab:
| 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 10.0.0.13 to network 0.0.0.0 10.0.0.0/30 is subnetted, 1 subnets |
Following this change, R1 is now able to ping the 150.2.2.0/24 and 150.3.3.0/24 subnets:
| 1#ping 150.2.2.2 repeat 10
Type escape sequence to abort. |
| R1#ping 150.3.3.3 repeat 10
Type escape sequence to abort. |
Final Router Configurations
R1
|
R1#term len 0 Current configuration : 1311 bytes R1# |
R2
|
R2#term len 0 Current configuration : 1006 bytes R2# |
R3
|
R3#term len 0 Current configuration : 1534 bytes R3# |
R4
|
R4#term len 0 Current configuration : 793 bytes R4# |
