Validation
R1
R1#show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 5
2 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
20.1.1.2 4 100 145 177 5 0 0 00:40:05 5
Total number of neighbors 1
Total number of Established sessions 1
Note: Check the prefixes learnt here are 5.
R1#
R1#show ip bgp
BGP table version is 5, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i 10.1.1.0/24 20.1.1.2 20 100 3465789 i
*>i 10.1.2.0/24 20.1.1.2 30 100 3465789 600 ?
*>i 10.1.3.0/24 20.1.1.2 10 400 400 ?
*>i 10.1.4.0/24 20.1.1.2 10 100 3465789 ?
*>i 10.1.5.0/24 20.1.1.2 10 100 3465789 ?
Total number of prefixes 5
R1#
Note: In the above example, 10.1.4.0/24 and 10.1.5.0/24 prefixes will match only on PF1 which is a super set prefix and metric is set as 10, while the 10.1.1.0/24, 10.1.2.0/24 and 10.1.3.0/24 prefixes will match in P1, P2 and P3 prefix-lists and execute the set clauses respectively.
R1#show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
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, L1 - IS-IS level-1, L2 - IS-IS level-2,
ia - IS-IS inter area, E - EVPN,
v - vrf leaked
* - candidate default
IP Route Table for VRF "default"
B 10.1.1.0/24 [200/20] via 20.1.1.2, xe51, 00:45:05
B 10.1.2.0/24 [200/30] via 20.1.1.2, xe51, 00:45:05
B 10.1.3.0/24 [200/10] via 20.1.1.2, xe51, 00:45:05
B 10.1.4.0/24 [200/10] via 20.1.1.2, xe51, 00:25:05
B 10.1.5.0/24 [200/10] via 20.1.1.2, xe51, 00:24:35
C 20.1.1.0/24 is directly connected, xe51, 01:00:40
C 127.0.0.0/8 is directly connected, lo, 02:26:41
Gateway of last resort is not set
R1#
R1#show ip bgp route-map myid1
BGP table version is 5, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i 10.1.1.0/24 20.1.1.2 20 100 3465789 i
*>i 10.1.2.0/24 20.1.1.2 30 100 3465789 600 ?
*>i 10.1.3.0/24 20.1.1.2 10 400 400 ?
*>i 10.1.4.0/24 20.1.1.2 10 100 3465789 ?
*>i 10.1.5.0/24 20.1.1.2 10 100 3465789 ?
Total number of prefixes 5
R1#
R1#
R2
R2#show ip bgp summary
BGP router identifier 2.2.2.2, local AS number 100
BGP table version is 3
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
20.1.1.1 4 100 133 133 3 0 0 00:39:57 0
Total number of neighbors 1
Total number of Established sessions 1
R2#
R2#
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,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.0/24 0.0.0.0 0 100 32768 ?
*> 10.1.2.0/24 0.0.0.0 0 100 32768 ?
*> 10.1.3.0/24 0.0.0.0 0 100 32768 ?
*> 10.1.4.0/24 0.0.0.0 0 100 32768 ?
*> 10.1.5.0/24 0.0.0.0 0 100 32768 ?
*> 20.1.1.0/24 0.0.0.0 0 100 32768 ?
Total number of prefixes 6
R2#
R2#show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
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, L1 - IS-IS level-1, L2 - IS-IS level-2,
ia - IS-IS inter area, E - EVPN,
v - vrf leaked
* - candidate default
IP Route Table for VRF "default"
C 10.1.1.0/24 is directly connected, xe32/1, 01:02:22
C 10.1.2.0/24 is directly connected, xe32/2, 01:01:46
C 10.1.3.0/24 is directly connected, xe32/4, 01:02:21
C 10.1.4.0/24 is directly connected, xe17/1, 00:26:52
C 10.1.5.0/24 is directly connected, xe21/1, 00:26:32
C 20.1.1.0/24 is directly connected, xe32/3, 01:02:22
C 127.0.0.0/8 is directly connected, lo, 01:34:40
Gateway of last resort is not set
R2#
Route-map Show Commands
R1#show running-config route-map
!
route-map myid1 permit 1
match ip address prefix-list PF1
continue
set metric 10
set weight 3465789
!
route-map myid1 permit 2
match ip address prefix-list P1
continue 3
set metric 20
set origin igp
!
route-map myid1 permit 3
match ip address prefix-list P2
continue 4
set metric 30
set as-path prepend 600
!
route-map myid1 permit 4
match ip address prefix-list P3
set local-preference 400
set weight 400
!
R1#
R1#show route-map
route-map myid1, permit, sequence 1
Match clauses:
ip address prefix-list: PF1
Continue clause: next sequence
Set clauses:
metric 10
weight 3465789
route-map myid1, permit, sequence 2
Match clauses:
ip address prefix-list: P1
Continue clause: sequence 3:
Set clauses:
metric 20
origin igp
route-map myid1, permit, sequence 3
Match clauses:
ip address prefix-list: P2
Continue clause: sequence 4:
Set clauses:
metric 30
as-path prepend 600
route-map myid1, permit, sequence 4
Match clauses:
ip address prefix-list: P3
Set clauses:
local-preference 400
weight 400