BGP Community: Lab Topology
BGP Community: Lab Topology
PNETLAB Store
PNETLab.com
BGP Community
Lab Topology:
Please use the following topology to complete this lab exercise:
Lab Objective:
The objective of this lab exercise is for you to learn and understand how can you configure BGP
Community.
Task list:
Task 1: Configure the hostname and IP address for the interface for Routers as topo. Check the
reachability between Routers.
Task 2: Configure EBGP at all Router. R1 advertise L0 interface to BGP. Check the status of
1.1.1.1/32 at the others Router.
1
Download PNETLab Platform
PNETLAB Store
PNETLab.com
Task 3: Config Community BGP at R1 and R3 so that R2 will choose the R4 is the next hop to
reach 1.1.1.1/32
Task 4: Check BGP Table on R3 and R2 to verify the configuration at Task 3.
SOLUTION:
Task 1: Configure the hostname and IP address for the interface for Routers as topo. Check the
reachability between Routers.
On R1
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0/0
ip address 10.1.13.1 255.255.255.0
!
interface Ethernet0/1
ip address 10.1.14.1 255.255.255.0
!
On R2
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface Ethernet0/1
ip address 10.1.23.2 255.255.255.0
!
interface Ethernet0/2
ip address 10.1.24.2 255.255.255.0
!
On R3
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Ethernet0/0
ip address 10.1.13.3 255.255.255.0
!
interface Ethernet0/1
ip address 10.1.23.3 255.255.255.0
!
On R4
!
2
Download PNETLab Platform
PNETLAB Store
PNETLab.com
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface Ethernet0/1
ip address 10.1.14.4 255.255.255.0
!
interface Ethernet0/2
ip address 10.1.24.4 255.255.255.0
!
Task 2: Configure EBGP at all Router. R1 advertise L0 interface to BGP. Check the status of
1.1.1.1/32 at the others Router.
On R1
!
router bgp 1
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
neighbor 10.1.13.3 remote-as 3
neighbor 10.1.14.4 remote-as 4
!
On R2
!
router bgp 2
bgp log-neighbor-changes
neighbor 10.1.23.3 remote-as 3
neighbor 10.1.24.4 remote-as 4
!
On R3
!
router bgp 3
bgp log-neighbor-changes
neighbor 10.1.13.1 remote-as 1
neighbor 10.1.23.2 remote-as 2
!
On R4
!
router bgp 4
bgp log-neighbor-changes
neighbor 10.1.14.1 remote-as 1
neighbor 10.1.24.2 remote-as 2
!
Verification:
R2#show ip bgp
BGP table version is 2, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal,
3
Download PNETLab Platform
PNETLAB Store
PNETLab.com
Task 3: Config Community BGP at R1 and R3 so that R2 will choose the R4 is the next hop to
reach 1.1.1.1/32
On R1
!
ip bgp-community new-format
!
ip prefix-list NETWORK seq 5 permit 1.1.1.1/32
!
route-map SET_COMMUNITY_NETWORK permit 10
match ip address prefix-list NETWORK
set community 12345:1
!
route-map SET_COMMUNITY_NETWORK permit 20
!
router bgp 1
neighbor 10.1.13.3 send-community
neighbor 10.1.13.3 route-map SET_COMMUNITY_NETWORK out
!
//Create Route-map to set community 12345:1 for ip prefix-list 1.
//Configure bgp neighbor with R3 but specify note that will add one community based on
Route-map.
On R3
!
ip bgp-community new-format
ip community-list 1 permit 12345:1
!
route-map COMMUNITY permit 10
match community 1
set as-path prepend 1 1 1 1 1
!
router bgp 3
neighbor 10.1.23.2 send-community
neighbor 10.1.23.2 route-map COMMUNITY out
!
4
Download PNETLab Platform
PNETLAB Store
PNETLab.com
//Config community-list 1 for create Route-map to match community with value 12345:1
//In Route-map, we set as-path prepend to 1 1 1 1 1 and set neighbor with R2 based on Route-
map.
//After configuration, please use command “clear ip bgp * soft” in both R1 and R3.
R2#show ip bgp
BGP table version is 3, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal,
5
Download PNETLab Platform
PNETLAB Store
PNETLab.com
//So we will recognize that, in R2, it will choose R4 is next hop to reach prefix 1.1.1.1/32
because of changing as-path from R3 via community.