0% found this document useful (0 votes)
306 views6 pages

BGP Community: Lab Topology

The document describes configuring BGP community attributes to influence route selection. It provides steps to configure EBGP between routers, advertise a prefix, and use communities to modify the AS path so the route through one neighbor is preferred.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
306 views6 pages

BGP Community: Lab Topology

The document describes configuring BGP community attributes to influence route selection. It provides steps to configure EBGP between routers, advertise a prefix, and use communities to modify the AS path so the route through one neighbor is preferred.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Download PNETLab Platform

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

r RIB-failure, S Stale, m multipath, b backup-path, f


RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path


* 1.1.1.1/32 10.1.24.4 0 4 1 i
*> 10.1.23.3 0 3 1 i
// So everything is normal, R2 will choose to learn 1.1.1.1/32 via 10.1.23.3

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.

Task 4: Check BGP Table on R3 and R2 to verify the configuration at Task 3.


On R3
R3#show ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 2
Paths: (2 available, best #2, table default)
Advertised to update-groups:
1
Refresh Epoch 1
2 4 1
10.1.23.2 from 10.1.23.2 (2.2.2.2)
Origin IGP, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
1
10.1.13.1 from 10.1.13.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: 12345:1
rx pathid: 0, tx pathid: 0x0

R2#show ip bgp 1.1.1.1


BGP routing table entry for 1.1.1.1/32, version 3
Paths: (2 available, best #1, table default)
Advertised to update-groups:
1
Refresh Epoch 1
4 1
10.1.24.4 from 10.1.24.4 (4.4.4.4)
Origin IGP, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
Refresh Epoch 1
3 1 1 1 1 1 1
10.1.23.3 from 10.1.23.3 (3.3.3.3)
Origin IGP, localpref 100, valid, external
Community: 12345:1
rx pathid: 0, tx pathid: 0

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

r RIB-failure, S Stale, m multipath, b backup-path, f


RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path


*> 1.1.1.1/32 10.1.24.4 0 4 1 i
* 10.1.23.3 0 3 1 1 1
1 1 1 i

R2#show ip cef 1.1.1.1/32


1.1.1.1/32
nexthop 10.1.24.4 Ethernet0/2

//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.

You might also like