12.1.2 Lab - Implement BGP Path Manipulation
12.1.2 Lab - Implement BGP Path Manipulation
Topology
Addressing Table
Device Interface IPv4 Address IPv6 Address IPv6 Link-Local
R1
S0/1/0 10.1.3.1/25 2001:db8:acad:1013::1/64 fe80::1:2
R1
S0/1/1 10.1.3.129/25 2001:db8:acad:1014::1/64 fe80::1:3
R1
Loopback0 192.168.1.1/27 2001:db8:acad:1000::1/64 fe80::1:4
R1
Loopback1 192.168.1.65/26 2001:db8:acad:1001::1/64 fe80::1:5
R2 G0/0/0 10.1.2.2/24 2001:db8:acad:1012::2/64 fe80::2:1
R2
G0/0/1 10.2.3.2/24 2001:db8:acad:1023::2/64 fe80::2:2
R2
Loopback0 192.168.2.1/27 2001:db8:acad:2000::1/64 fe80::2:4
R2
Loopback1 192.168.2.65/26 2001:db8:acad:2001::1/64 fe80::2:4
R3 G0/0/0 10.2.3.3/24 2001:db8:acad:1023::3/64 fe80::3:1
R3
S0/1/0 10.1.3.3/25 2001:db8:acad:1013::3/64 fe80::3:2
R3
S0/1/1 10.1.3.130/25 2001:db8:acad:1014::3/64 fe80::3:3
R3
Loopback0 192.168.3.1/27 2001:db8:acad:3000::1/64 fe80::3:4
R3
Loopback1 192.168.3.65/26 2001:db8:acad:3001::1/64 fe80::3:5
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
Objectives
Part 1: Build the Network and Configure Basic Device Settings and Interface Addressing
Part 2: Configure and Verify Multi-Protocol BGP on all Routers
Part 3: Configure and Verify BGP Path Manipulation Settings on all Routers
Background / Scenario
The default settings in BGP allow for a great deal of undesired route information to pass between
autonomous systems. In this lab you will configure Multi-Protocol BGP and implement various path
manipulation options for both IPv4 and IPv6.
Note: This lab is an exercise in developing, deploying, and verifying various path manipulation tools for BGP,
and does not reflect networking best practices.
Note: The routers used with CCNP hands-on labs are Cisco 4221 with Cisco IOS XE Release 16.9.4
(universalk9 image). Other routers and Cisco IOS versions can be used. Depending on the model and Cisco
IOS version, the commands available and the output produced might vary from what is shown in the labs.
Note: Ensure that the routers have been erased and have no startup configurations. If you are unsure contact
your instructor.
Required Resources
3 Routers (Cisco 4221 with Cisco IOS XE Release 16.9.4 universal image or comparable)
1 PC (Choice of operating system with a terminal emulation program installed)
Console cables to configure the Cisco IOS devices via the console ports
Ethernet and serial cables as shown in the topology
Instructions
Part 1: Build the Network and Configure Basic Device Settings and Interface
Addressing
In Part 1, you will set up the network topology and configure basic settings and interface addressing on
routers.
Router R1
no ip domain lookup
hostname R1
line con 0
exec-timeout 0 0
logging synchronous
banner motd # This is R1, BGP Path Manipulation Lab #
ipv6 unicast-routing
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
interface g0/0/0
ip address 10.1.2.1 255.255.255.0
ipv6 address fe80::1:1 link-local
ipv6 address 2001:db8:acad:1012::1/64
no shutdown
interface s0/1/0
ip address 10.1.3.1 255.255.255.128
ipv6 address fe80::1:2 link-local
ipv6 address 2001:db8:acad:1013::1/64
no shutdown
interface s0/1/1
ip address 10.1.3.129 255.255.255.128
ipv6 address fe80::1:3 link-local
ipv6 address 2001:db8:acad:1014::1/64
no shutdown
interface loopback 0
ip address 192.168.1.1 255.255.255.224
ipv6 address fe80::1:4 link-local
ipv6 address 2001:db8:acad:1000::1/64
no shutdown
interface loopback 1
ip address 192.168.1.65 255.255.255.192
ipv6 address fe80::1:5 link-local
ipv6 address 2001:db8:acad:1001::1/64
no shutdown
Router R2
no ip domain lookup
hostname R2
line con 0
exec-timeout 0 0
logging synchronous
banner motd # This is R2, BGP Path Manipulation Lab #
ipv6 unicast-routing
interface g0/0/0
ip address 10.1.2.2 255.255.255.0
ipv6 address fe80::2:1 link-local
ipv6 address 2001:db8:acad:1012::2/64
no shutdown
interface g0/0/1
ip address 10.2.3.2 255.255.255.0
ipv6 address fe80::2:2 link-local
ipv6 address 2001:db8:acad:1023::2/64
no shutdown
interface loopback 0
ip address 192.168.2.1 255.255.255.224
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
4 300 8 8 9 0 0 00:02:13 4
b. Use the show bgp ipv4 unicast and show bgp ipv6 unicast commands to view the specified BGP
tables. Note that R1 has multiple paths to each destination network. Take note of the next hop address for
the destination networks marked with the “>” symbol.
R1# show bgp ipv4 unicast | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 192.168.1.0/27 0.0.0.0 0 32768 i
*> 192.168.1.64/26 0.0.0.0 0 32768 i
* 192.168.2.0/27 10.1.3.130 0 300 500 i
*> 10.1.2.2 0 0 500 i
* 10.1.3.3 0 300 500 i
* 192.168.2.64/26 10.1.3.130 0 300 500 i
*> 10.1.2.2 0 0 500 i
* 10.1.3.3 0 300 500 i
* 192.168.3.0/27 10.1.3.130 0 0 300 i
* 10.1.2.2 0 500 300 i
*> 10.1.3.3 0 0 300 i
* 192.168.3.64/26 10.1.3.130 0 0 300 i
* 10.1.2.2 0 500 300 i
*> 10.1.3.3 0 0 300 i
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
2001:DB8:ACAD:1013::3
0 0 300 i
* 2001:DB8:ACAD:1012::2
0 500 300 i
* 2001:DB8:ACAD:1014::3
0 0 300 i
c. Use the show ip route bgp and show ipv6 route bgp commands to view the routing tables. Note that
there is only one route to each destination, and that the routes included in the routing table have the same
next hop as those with the “>” symbol in the BGP tables.
R1# show ip route bgp | begin Gateway
Gateway of last resort is not set
Part 3: Configure and Verify BGP Path Manipulation Settings on all Routers
In Part 3, you will configure path manipulation tools for BGP. The way these tools are being used here is not
meant to represent best practice, but to assess your ability to complete the required configurations.
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
b. On R3, configure an access list designed to match the source address and mask of the networks
belonging to ASN300:
R3(config)# ip access-list extended ALLOWED_TO_R1
R3(config-ext-nacl)# permit ip 192.168.3.0 0.0.0.0 255.255.255.224 0.0.0.0
R3(config-ext-nacl)# permit ip 192.168.3.64 0.0.0.0 255.255.255.192 0.0.0.0
R3(config-ext-nacl)# exit
c. On R3, apply the ALLOWED_TO_R1 ACL as a distribute list to the IPv4 neighbor adjacencies with R1.
R3(config)# router bgp 300
R3(config-router)# address-family ipv4 unicast
R3(config-router-af)# neighbor 10.1.3.1 distribute-list ALLOWED_TO_R1 out
R3(config-router-af)# neighbor 10.1.3.129 distribute-list ALLOWED_TO_R1 out
R3(config-router-af)# end
d. Perform a reset of the IPv4 adjacency with R1 for the outbound traffic without tearing down the session.
R3# clear bgp ipv4 unicast 6500 out
e. On R1, issue the command show bgp ipv4 unicast | i 300 to see what prefixes routes ASN300 is now
sharing via BGP. All of the prefixes should now originate in ASN300:
R1# show bgp ipv4 unicast | i 300
* 192.168.3.0/27 10.1.2.2 0 500 300 i
*> 10.1.3.3 0 0 300 i
* 10.1.3.130 0 0 300 i
* 192.168.3.64/26 10.1.2.2 0 500 300 i
*> 10.1.3.3 0 0 300 i
* 10.1.3.130 0 0 300 i
Close configuration window
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
b. On R1, configure a prefix list designed to match the source address and mask of networks belonging to
ASN500.
R1(config)# ip prefix-list ALLOWED_FROM_R2 seq 5 permit 192.168.2.0/24 le 27
c. Apply the ALLOWED_FROM_R2 prefix list to the IPv4 neighbor adjacencies for R2.
R1(config)# router bgp 6500
R1(config-router)# address-family ipv4 unicast
R1(config-router-af)# neighbor 10.1.2.2 prefix-list ALLOWED_FROM_R2 in
R1(config-router-af)# end
d. Perform a reset of the IPv4 adjacency with R2 for the inbound traffic without tearing down the session.
R1# clear bgp ipv4 unicast 500 in
e. On R1, issue the command show bgp ipv4 unicast | i 500 to see what prefixes routes ASN500 is now
sharing via BGP. All of the prefixes should now originate in ASN500.
R1# show bgp ipv4 unicast | i 500
*> 192.168.2.0/27 10.1.2.2 0 0 500 i
*> 192.168.2.64/26 10.1.2.2 0 0 500 i
Close configuration window
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
e. On R2, issue the command show bgp ipv4 unicast | i 6500 to see what prefixes routes ASN6500 is now
sharing via BGP. All of the prefixes should now originate in ASN6500.
R2# show bgp ipv4 unicast | i 6500
* 192.168.1.0/27 10.2.3.3 0 300 6500 i
*> 10.1.2.1 0 0 6500 i
* 192.168.1.64/26 10.2.3.3 0 300 6500 i
*> 10.1.2.1 0 0 6500 i
Close configuration window
b. On R1, configure an IPv6 prefix list designed to match the source address and mask of networks
belonging to ASN500.
R1(config)# ipv6 prefix-list IPV6_ALLOWED_FROM_R2 seq 5 permit
2001:db8:acad:2000::/64
R1(config)# ipv6 prefix-list IPV6_ALLOWED_FROM_R2 seq 10 permit
2001:db8:acad:2001::/64
c. Apply the IPV6_ALLOWED_FROM_R2 prefix list to the IPv6 neighbor adjacencies for R2.
R1(config)# router bgp 6500
R1(config-router)# address-family ipv6 unicast
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 11 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
f. Configure and apply an IPv6 filter to do the same thing on the adjacency with ASN300.
Close configuration window
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 12 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
Refresh Epoch 1
300
10.1.3.130 from 10.1.3.130 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
b. On R1, configure a prefix list designed to match the source address and mask of networks belonging to
ASN300.
R1(config)# ip prefix-list PREFERRED_IPV4_PATH seq 5 permit 192.168.3.0/24 le 27
c. Create a route-map named USE_THIS_PATH_FOR_IPV4 that matches on the prefix list you just created
and sets the local preference to 250.
R1(config)# route-map USE_THIS_PATH_FOR_IPV4 permit 10
R1(config)# match ip address prefix-list PERFERRED_IPV4_PATH
R1(config)# set local-preference 250
d. Next, apply this route map to the BGP neighbor 10.1.3.130.
R1(config)# router bgp 6500
R1(config-router)# address-family ipv4 unicast
R1(config-router-af)# neighbor 10.1.3.130 route-map USE_THIS_PATH_FOR_IPV4 in
R1(config-router-af)# end
e. Perform a reset of the IPv4 adjacency with R3 for the inbound traffic without tearing down the session.
R1# clear bgp ipv4 unicast 300 in
f. On R1, issue the command show ip route bgp and take note of the next hop addresses for the
192.168.3.0/27 and 192.168.3.64/26 networks; it should be 10.1.3.130 for both. Issue the command
show bgp ipv4 unicast and you should see the local preference value in the appropriate column.
R1# show ip route bgp | begin Gateway
Gateway of last resort is not set
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 13 of 14 www.netacad.com
Lab - Implement BGP Path Manipulation
Note: To find out how the router is configured, look at the interfaces to identify the type of router and how many
interfaces the router has. There is no way to effectively list all the combinations of configurations for each router
class. This table includes identifiers for the possible combinations of Ethernet and Serial interfaces in the device.
The table does not include any other type of interface, even though a specific router may contain one. An example
of this might be an ISDN BRI interface. The string in parenthesis is the legal abbreviation that can be used in
Cisco IOS commands to represent the interface.
End of document
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 14 of 14 www.netacad.com