0% found this document useful (0 votes)
52 views

BGP Demo Scripts

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

BGP Demo Scripts

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Basic BGP DEMO

Setup
R1:
ena
conf t
host R1
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


logging synch
exit
no ip domain-lookup
int gig 0/1
ip address 192.0.2.1 255.255.255.0
no shut
int gig 0/2
ip address 198.51.100.1 255.255.255.252
no shut
end
copy run star

R2:
ena
conf t
host R2
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/1
ip address 198.51.100.2 255.255.255.252
no shut
int gig 0/2
ip address 203.0.113.1 255.255.255.0
no shut
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
end
copy run star

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


Basic BGP DEMO
R1:
R1#conf term
R1(config)#router bgp 64500
R1(config-router)#neighbor 198.51.100.2 remote-as 64495
R1(config-router)#network 192.0.2.0 mask 255.255.255.0
R1(config-router)#end
R1#

R2:
R2#conf term
R2(config)#router bgp 64495
R2(config-router)#neighbor 198.51.100.1 remote-as 64500
R2(config-router)#network 203.0.113.0 mask 255.255.255.0
R2(config-router)#end
R2#show ip route
R2#show ip bgp

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


BGP Synchronization
DEMO
Setup

R1:
ena
conf t
host R1
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/0
ip address 10.1.1.1 255.255.255.252

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


no shut
int lo 0
ip address 1.1.1.1 255.255.255.255
exit
router bgp 65100
neighbor 10.1.1.2 remote-as 65200
network 1.1.1.1 mask 255.255.255.255
network 10.1.1.0 mask 255.255.255.252
end
copy run star

R2:
ena
conf t
host R2
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/0
ip address 10.1.1.2 255.255.255.252
no shut
int gig 0/1
ip address 172.16.1.1 255.255.255.252
no shut
int lo0
ip address 2.2.2.2 255.255.255.255
router bgp 65200
neighbor 172.16.1.2 remote-as 65200
neighbor 10.1.1.1 remote-as 65100
network 2.2.2.2 mask 255.255.255.255
network 172.16.1.0 mask 255.255.255.252
network 10.1.1.0 mask 255.255.255.252
end
copy run star

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


R3:
ena
conf t
host R3
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/0
ip address 172.16.1.2 255.255.255.252
no shut
int lo0
ip address 3.3.3.3 255.255.255.255
router bgp 65200
neighbor 172.16.1.1 remote-as 65200
network 3.3.3.3 mask 255.255.255.255
network 172.16.1.0 mask 255.255.255.252
end
copy run star

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


BGP Synchronization DEMO
R1:
R1#show ip bgp
BGP table version is 6, 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, m multipath, b backup-path, f RT-
Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
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 0.0.0.0 0 32768 i
*> 2.2.2.2/32 10.1.1.2 0 0 65200 i
*> 3.3.3.3/32 10.1.1.2 0 65200 i
* 10.1.1.0/30 10.1.1.2 0 0 65200 i
*> 0.0.0.0 0 32768 i
*> 172.16.1.0/30 10.1.1.2 0 0 65200 i

R2:

Let’s enable BGP Synchronization on R2.

R2#conf term
R2(config)#router bgp 65200
R2(config-router)#synchronization
R2(config-router)#end
R2#clear ip bgp *
R2#

[NOTE: Wait for neighborships to reestablish.]

R2#show ip bgp
BGP table version is 7, 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, m multipath, b backup-path, f RT-
Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
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.1.1 0 0 65100 i
*> 2.2.2.2/32 0.0.0.0 0 32768 i
* i 3.3.3.3/32 172.16.1.2 0 100 0 i
*> 10.1.1.0/30 0.0.0.0 0 32768 i
* 10.1.1.1 0 0 65100 i
*> 172.16.1.0/30 0.0.0.0 0 32768 i

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


* i 172.16.1.2 0 100 0 i
R2#

R2 still knows about 3.3.3.3 /32, but what about R1?

R1:
R1#show ip bgp
BGP table version is 12, 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, m multipath, b backup-path, f RT-
Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
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 0.0.0.0 0 32768 i
*> 2.2.2.2/32 10.1.1.2 0 0 65200 i
* 10.1.1.0/30 10.1.1.2 0 0 65200 i
*> 0.0.0.0 0 32768 i
*> 172.16.1.0/30 10.1.1.2 0 0 65200 i
R1#

Notice the 3.3.3.3 /32 route is missing from R1, because R2 was configured for BGP Synchronization. We could
either disable BGP Synchronization or configure an IGP in AS 65200 to advertise the 3.3.3.3 /32 network. Let’s
setup OSPF in AS 65200

R2:
R2#conf term
R2(config)#router ospf 1
R2(config-router)#network 0.0.0.0 255.255.255.255 area 0
R2(config-router)#end
R2#

R3:
R3#conf term
R3(config)#router ospf 1
R3(config-router)#network 0.0.0.0 255.255.255.255 area 0
R3(config-router)#end
R3#

Let’s see if router R2 has learned about 3.3.3.3 /32 via an IGP, which is OSPF in our case.

R2:
R2#show ip route
Codes: L - local, 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

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets


B 1.1.1.1 [20/0] via 10.1.1.1, 00:04:36
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 172.16.1.2, 00:00:01, GigabitEthernet0/1
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/30 is directly connected, GigabitEthernet0/0
L 10.1.1.2/32 is directly connected, GigabitEthernet0/0
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/30 is directly connected, GigabitEthernet0/1
L 172.16.1.1/32 is directly connected, GigabitEthernet0/1
R2#

Yes, it has. That means the 3.3.3.3 /32 is now “synchronized” between the BGP and IGP routing tables, which
permits R2 to advertise it to its eBGP peer of R1. Let’s confirm that on R1.

R2:
R1#show ip bgp
BGP table version is 13, 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, m multipath, b backup-path, f RT-
Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
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 0.0.0.0 0 32768 i
*> 2.2.2.2/32 10.1.1.2 0 0 65200 i
*> 3.3.3.3/32 10.1.1.2 0 65200 i
* 10.1.1.0/30 10.1.1.2 0 0 65200 i
*> 0.0.0.0 0 32768 i
*> 172.16.1.0/30 10.1.1.2 0 0 65200 i
R1#

The 3.3.3.3 /32 network is now visible on R1.

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


Multihop and
Summarization DEMO
Setup

R1:
ena
conf t
host R1
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/0
ip address 198.51.100.1 255.255.255.252
no shut
int lo0
ip address 10.1.0.1 255.255.255.0

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


int lo1
ip address 10.1.1.1 255.255.255.0
int lo2
ip address 10.1.2.1 255.255.255.0
int lo3
ip address 10.1.3.1 255.255.255.0
router bgp 65000
neighbor 198.51.100.2 remote-as 65100
network 10.1.0.0 mask 255.255.255.0
network 10.1.1.0 mask 255.255.255.0
network 10.1.2.0 mask 255.255.255.0
network 10.1.3.0 mask 255.255.255.0
network 198.51.100.0 mask 255.255.255.252
end
copy run star

R2:
ena
conf t
host R2
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/0
ip address 198.51.100.2 255.255.255.252
no shut
int gig 0/1
ip address 203.0.113.1 255.255.255.252
no shut
router bgp 65100
neighbor 198.51.100.1 remote-as 65000
neighbor 203.0.113.2 remote-as 65200
network 198.51.100.0 mask 255.255.255.252
network 203.0.113.0 mask 255.255.255.252

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


end
copy run star

R3:
ena
conf t
host R3
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/0
ip address 203.0.113.2 255.255.255.252
no shut
router bgp 65200
neighbor 203.0.113.1 remote-as 65100
network 203.0.113.0 mask 255.255.255.252
end
copy run star

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


Summarization and Multihop DEMO
Let’s begin by taking a look at the network known to R3’s BGP routing process.

R3:
R3#show ip bgp
BGP table version is 7, local router ID is 203.0.113.2
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-
Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path


*> 10.1.0.0/24 203.0.113.1 0 65100 65000 i
*> 10.1.1.0/24 203.0.113.1 0 65100 65000 i
*> 10.1.2.0/24 203.0.113.1 0 65100 65000 i
*> 10.1.3.0/24 203.0.113.1 0 65100 65000 i
*> 198.51.100.0/30 203.0.113.1 0 0 65100 i
* 203.0.113.0/30 203.0.113.1 0 0 65100 i
*> 0.0.0.0 0 32768 i
R3#

All of the 10 networks could be summarized with a single advertisement of 10.1.0.0 /22, because they all have the
first 22 bits in common. Let’s configure R1 to only send a summary of those networks.

R1:

R1#conf term
R1(config)#router bgp 65000
R1(config-router)#aggregate-address 10.1.0.0 255.255.252.0 summary-only
R1(config-router)#end
R1#

Let’s go back to R3 and see if we now only see a summary address for the 10 networks.

R3:

R3#show ip bgp
BGP table version is 12, local router ID is 203.0.113.2
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-
Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path


*> 10.1.0.0/22 203.0.113.1 0 65100 65000 i
*> 198.51.100.0/30 203.0.113.1 0 0 65100 i
* 203.0.113.0/30 203.0.113.1 0 0 65100 i
*> 0.0.0.0 0 32768 i
R3#

And we do. Next, let’s see what BGP neighbors R3 has.

R3#show ip bgp summary


BGP router identifier 203.0.113.2, local AS number 65200
BGP table version is 12, main routing table version 12
3 network entries using 432 bytes of memory
4 path entries using 336 bytes of memory
3/3 BGP path/bestpath attribute entries using 480 bytes of memory
2 BGP AS-PATH entries using 48 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 1296 total bytes of memory
BGP activity 7/4 prefixes, 8/4 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down


State/PfxRcd
203.0.113.1 4 65100 16 13 12 0 0 00:08:58
3
R3#

Currently, it’s only R2. However, it’s possible to make a non-adjacent eBGP router a neighbor by using the
Multihop feature. Let’s set it up to make R1 and R3 non-adjacent neighbors.

R3#conf term
R3(config)#router bgp 65200
R3(config-router)#neighbor 198.51.100.1 remote-as 65000
R3(config-router)#neighbor 198.51.100.1 ebgp-multihop 2
R3(config-router)#end
R3#

R1:

R1#conf term
R1(config)#router bgp 65000
R1(config-router)#neighbor 203.0.113.2 remote-as 65200
R1(config-router)#neighbor 203.0.113.2 ebgp-multihop 2
R1(config-router)#end
R1#show ip bgp summary
BGP router identifier 10.1.3.1, local AS number 65000
BGP table version is 12, main routing table version 12
7 network entries using 1008 bytes of memory
10 path entries using 840 bytes of memory
5/3 BGP path/bestpath attribute entries using 800 bytes of memory
3 BGP AS-PATH entries using 72 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

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


BGP using 2720 total bytes of memory
BGP activity 7/0 prefixes, 10/0 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down


State/PfxRcd
198.51.100.2 4 65100 22 22 12 0 0 00:15:09
2
203.0.113.2 4 65200 10 8 12 0 0 00:00:11
2
R1#

This confirms that R1 and R3 are eBGP neighbors, even though they’re not physically adjacent.

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


Advanced BGP Demo

Setup
R1:
ena
conf t

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


host R1
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/1
ip address 172.16.1.1 255.255.255.0
no shut
router bgp 65001
bgp router-id 1.1.1.1
network 172.16.1.0 mask 255.255.255.0
neighbor 172.16.1.2 remote-as 65001
end
copy run star

R2:
ena
conf t
host R2
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/1
ip address 172.16.1.2 255.255.255.0
no shut

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


int gig 0/2
ip address 10.1.1.2 255.255.255.0
no shut
router bgp 65001
bgp router-id 2.2.2.2
network 172.16.1.0 mask 255.255.255.0
network 10.1.1.0 mask 255.255.255.0
neighbor 172.16.1.1 remote-as 65001
neighbor 10.1.1.1 remote-as 65001
end
copy run star

R3:
ena
conf t
host R3
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/1
ip address 10.1.1.1 255.255.255.0
no shut
int gig 0/2
speed 10
ip address 198.51.100.1 255.255.255.252
no shut
int gig 0/3
speed 100
ip address 198.51.100.5 255.255.255.252
no shut
ip prefix-list BGP-DEMO seq 5 deny 10.0.0.0/8 le 32
ip prefix-list BGP-DEMO seq 10 deny 172.16.0.0/12 le 32
ip prefix-list BGP-DEMO seq 15 deny 192.168.0.0/16 le 32
ip prefix-list BGP-DEMO seq 20 permit 0.0.0.0/0

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


ip prefix-list BGP-DEMO seq 25 permit 0.0.0.0/0 ge 8
end
copy run star

ISP1:
ena
conf t
host ISP1
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup
int gig 0/1
ip address 198.51.100.2 255.255.255.252
no shut
int gig 0/2
ip address 203.0.113.1 255.255.255.252
no shut
router bgp 65002
bgp router-id 4.4.4.4
network 198.51.100.0 mask 255.255.255.252
network 203.0.113.0 mask 255.255.255.252
neighbor 198.51.100.1 remote-as 65001
neighbor 203.0.113.2 remote-as 65003
end
copy run star

INET:
ena
conf t
host INET
no banner motd
no banner login
no banner exec
no banner incoming

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
int lo0
ip address 5.5.5.5 255.255.255.0
no ip domain-lookup
int gig 0/1
ip address 203.0.113.2 255.255.255.252
no shut
int gig 0/2
ip address 203.0.113.5 255.255.255.252
no shut
router bgp 65003
bgp router-id 5.5.5.5
network 203.0.113.0 mask 255.255.255.252
network 203.0.113.4 mask 255.255.255.252
network 5.5.5.0 mask 255.255.255.0
neighbor 203.0.113.1 remote-as 65002
neighbor 203.0.113.6 remote-as 65004
end
copy run star

ISP2:
ena
conf t
host ISP2
no banner motd
no banner login
no banner exec
no banner incoming
line vty 0 15
password cisco
login
exec-timeout 0 0
line con 0
exec-timeout 0 0
logging synch
exit
no ip domain-lookup

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


int gig 0/1
ip address 198.51.100.6 255.255.255.252
no shut
int gig 0/2
ip address 203.0.113.6 255.255.255.252
no shut
router bgp 65004
bgp router-id 6.6.6.6
network 203.0.113.4 mask 255.255.255.252
network 198.51.100.4 mask 255.255.255.252
neighbor 203.0.113.5 remote-as 65003
neighbor 198.51.100.5 remote-as 65001
end
copy run star

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


Advanced BGP DEMO
For time reasons, BGP has been configured on all routers except R3.

Configure R3 to advertise its attached internal network and to form neighborships with routers R1, ISP1, and ISP2.
Note that we might not want R3 to advertise the networks connecting it to ISP1 or ISP2, because if we did, we
might inadvertently become a transit area for Internet traffic from outside devices.

R3:
R3#conf term
R3(config)#router bgp 65001
R3(config-router)#bgp router-id 3.3.3.3
R3(config-router)#neighbor 10.1.1.2 remote-as 65001
R3(config-router)#neighbor 198.51.100.2 remote-as 65002
R3(config-router)#neighbor 198.51.100.6 remote-as 65004
R3(config-router)#network 10.1.1.0 mask 255.255.255.0
R3(config-router)#end
R3#

Verify the BGP configuration on router R3.

See routes know to BGP and identify preferred routes and AS paths.

R3#show ip bgp
BGP table version is 8, 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, 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


*> 5.5.5.0/24 198.51.100.2 0 65002 65003 i
* 198.51.100.6 0 65004 65003 i
*> 10.1.1.0/24 0.0.0.0 0 32768 i
* i 10.1.1.2 0 100 0 i
*>i 172.16.1.0/24 10.1.1.2 0 100 0 i
r> 198.51.100.0/30 198.51.100.2 0 0 65002 i
r 198.51.100.4/30 198.51.100.2 0 65002 65003 65004 i
r> 198.51.100.6 0 0 65004 i
*> 203.0.113.0/30 198.51.100.2 0 0 65002 i
* 198.51.100.6 0 65004 65003 i
* 203.0.113.4/30 198.51.100.2 0 65002 65003 i
*> 198.51.100.6 0 0 65004 i
R3#

Things to point out:


• Two paths to 5.5.5.5 (Router ID is the tie-breaker)
• The “>” sign means the “best” path.
• The “r” stands for a RIB failure, which means BGP was unable to successfully install that route know to BGP
into the routers IP routing table (i.e., the Routing Information Base, or RIB). Reasons this could happen,

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


because the route is known from another routing source with a more believable administrative distance.
In this case, those networks marked with an “r” are directly attached to router R3. A connected route as
an administrative distance of 0. That’s why these routes known to BGP couldn’t be installed in the router’s
IP routing table.
• The way the AS Path is structured

View BGP neighbor information.

R3#show ip bgp summary


BGP router identifier 3.3.3.3, local AS number 65001
BGP table version is 8, main routing table version 8
7 network entries using 1008 bytes of memory
12 path entries using 960 bytes of memory
7/5 BGP path/bestpath attribute entries using 1064 bytes of memory
5 BGP AS-PATH entries using 120 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 3152 total bytes of memory
BGP activity 28/21 prefixes, 56/44 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ


Up/Down State/PfxRcd
10.1.1.2 4 65001 22 23 8 0 0 00:14:54 2
198.51.100.2 4 65002 24 24 8 0 0 00:15:05 5
198.51.100.6 4 65004 24 23 8 0 0 00:15:02 4
R3#

Get VERY Detailed Neighbor Information


R3#show ip bgp neighbors
BGP neighbor is 10.1.1.2, remote AS 65001, internal link
BGP version 4, remote router ID 2.2.2.2
BGP state = Established, up for 00:14:16
Last read 00:00:43, last write 00:00:41, hold time is 180, keepalive interval is 60
seconds
Neighbor sessions:
1 active, is not multisession capable (disabled)
Neighbor capabilities:
Route refresh: advertised and received(new)
Four-octets ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Enhanced Refresh Capability: advertised and received
Multisession Capability:
Stateful switchover support enabled: NO for session 1
...OUTPUT OMITTED...

Next, let’s see if router R3 has reachability to our “generic Internet address” of 5.5.5.5.

R3#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/4/5 ms
R3#

Success! Now, let’s see if router R2 has learned about all the routes in the network:

R2:
R2#show ip bgp

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


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,
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


* i 5.5.5.0/24 198.51.100.2 0 100 0 65002 65003 i
* i 10.1.1.0/24 10.1.1.1 0 100 0 i
*> 0.0.0.0 0 32768 i
*> 172.16.1.0/24 0.0.0.0 0 32768 i
* i 172.16.1.1 0 100 0 i
* i 198.51.100.0/30 198.51.100.2 0 100 0 65002 i
* i 198.51.100.4/30 198.51.100.6 0 100 0 65004 i
* i 203.0.113.0/30 198.51.100.2 0 100 0 65002 i
* i 203.0.113.4/30 198.51.100.6 0 100 0 65004 i
R2#

I see all the networks in our topology in the BGP table. Now, let’s see if we can once again ping our generic
Internet address of 5.5.5.5.

R2#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R2#

That fails! We know that we have a route in our BGP Topology table for 5.5.5.5. However, let’s see if it made it into
our IP routing table:

R2#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks


C 10.1.1.0/24 is directly connected, GigabitEthernet0/2
L 10.1.1.2/32 is directly connected, GigabitEthernet0/2
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, GigabitEthernet0/1
L 172.16.1.2/32 is directly connected, GigabitEthernet0/1
R2#

Router R2’s IP routing table doesn’t seem to have learned any routes via BGP. Why is that?

Let’s take a closer look at our BGP Topology table on router 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,

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.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


* i 5.5.5.0/24 198.51.100.2 0 100 0 65002 65003 i
* i 10.1.1.0/24 10.1.1.1 0 100 0 i
*> 0.0.0.0 0 32768 i
*> 172.16.1.0/24 0.0.0.0 0 32768 i
* i 172.16.1.1 0 100 0 i
* i 198.51.100.0/30 198.51.100.2 0 100 0 65002 i
* i 198.51.100.4/30 198.51.100.6 0 100 0 65004 i
* i 203.0.113.0/30 198.51.100.2 0 100 0 65002 i
* i 203.0.113.4/30 198.51.100.6 0 100 0 65004 i
R2#

This is telling us that in order to get to 5.5.5.5, we need to use a next-hop IP address of 198.51.100.2.
Unfortunately, we don’t know how to get to 198.51.100.2, because with Internal BGP (or iBGP), within an
autonomous system, when one router in an AS is advertising a route to another router within the same AS, the
“Next Hop” information is not updated.

The good news is, there’s a way to fix that. We can use the NEXT-HOP-SELF option when router R3 is pointing to its
neighbor of R2. So, any routes R3 advertised to R2 will be marked in such a way that router R3 is the next hop to
reach those networks.

R3:

R3#conf term
R3(config)#router bgp 65001
R3(config-router)#neighbor 10.1.1.2 next-hop-self
R3(config-router)#end
R3#clear ip bgp *

Now, let’s see what things look like from the perspective of R2.

R2:
R2#show ip bgp
BGP table version is 8, 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, 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


*>i 5.5.5.0/24 10.1.1.1 0 100 0 65002 65003 i
* i 10.1.1.0/24 10.1.1.1 0 100 0 i
*> 0.0.0.0 0 32768 i
*> 172.16.1.0/24 0.0.0.0 0 32768 i
* i 172.16.1.1 0 100 0 i
*>i 198.51.100.0/30 10.1.1.1 0 100 0 65002 i
*>i 198.51.100.4/30 10.1.1.1 0 100 0 65004 i
*>i 203.0.113.0/30 10.1.1.1 0 100 0 65002 i
*>i 203.0.113.4/30 10.1.1.1 0 100 0 65004 i

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


R2#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/5/6 ms
R2#

We’re now successful. Now, let’s continue with our verification be shifting our attention over to router R1, and see
what it knows.

R1:
R1#show ip bgp
BGP table version is 7, 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, 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


*>i 10.1.1.0/24 172.16.1.2 0 100 0 i
* i 172.16.1.0/24 172.16.1.2 0 100 0 i
*> 0.0.0.0 0 32768 i
R1#

It looks like R1, can only see networks inside its AS. What might be going on?

Well, here’s a rule BGP has: A BGP router says, “If I learn a route from another router in my Autonomous System,
I’m not going to advertise it to any other neighbors in my Autonomous System.” In this case, it means router R2
is not going to learn about routes it learned from R3 to R1.

An easy way to fix that is to make R1 and R3 neighbors. If they’re neighbors, then we’ve formed a full-mesh of
adjacencies with AS 65001. While that might be just fine for this example, where we only have three routers in the
AS, what if we had a dozen or more? That doesn’t scale well at all.

What we can do to address this is to configure a Route Reflector. In this example, we’re going to have all routers
within AS 65001 form a neighborship with router R2. Then, we’ll make router R2 act as a “Route Reflector,” where
when it learns a route from an iBGP neighbor, it will advertise that route to all other iBGP neighbors.

R2:

R2#conf term
R2(config)#router bgp 65001
R2(config-router)#neighbor 172.16.1.1 route-reflector-client
R2(config-router)#neighbor 10.1.1.1 route-reflector-client
R2(config-router)#end
R2#

Now if we go to router R1, it should have learned about all the routes in the network and be able to reach the
“Internet.”

R1:

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


R1#show ip bgp
BGP table version is 24, 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, 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


*>i 5.5.5.0/24 10.1.1.1 0 100 0 65002 65003 i
*>i 10.1.1.0/24 172.16.1.2 0 100 0 i
* i 172.16.1.0/24 172.16.1.2 0 100 0 i
*> 0.0.0.0 0 32768 i
*>i 198.51.100.0/30 10.1.1.1 0 100 0 65002 i
*>i 198.51.100.4/30 10.1.1.1 0 100 0 65004 i
*>i 203.0.113.0/30 10.1.1.1 0 100 0 65002 i
*>i 203.0.113.4/30 10.1.1.1 0 100 0 65004 i
R1#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1#

Router R1’s BGP Topology table knows about all of the routes in the topology, but we’re not able to reach the
“Internet.” Based on what we’ve see today, can you figure out what’s going on?

It’s that same NEXT-HOP-SELF issue we saw earlier. Specifically, the next hop to get to 5.5.5.5 is 10.1.1.1, and the
next hop to get to 10.1.1.1 is 172.16.1.2, and the next hop to get to 172.16.1.2 is 172.16.1.2 itself! And, we don’t
know how to get there. So, let’s go to R2, and tell R2 to list itself as the next hop for networks advertised to the
other routers in its autonomous system, specific networks advertised to routers R1 and R3.

R2:
R2#conf term
R2(config)#router bgp 65001
R2(config-router)#neighbor 172.16.1.1 next-hop-self
R2(config-router)#neighbor 10.1.1.1 next-hop-self
R2(config-router)#end
R2#clear ip bgp *

Let’s see if things are better now:

R1:
R1#show ip bgp
BGP table version is 36, 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, 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


*>i 5.5.5.0/24 10.1.1.1 0 100 0 65002 65003 i
*>i 10.1.1.0/24 172.16.1.2 0 100 0 i
* i 172.16.1.0/24 172.16.1.2 0 100 0 i
*> 0.0.0.0 0 32768 i
*>i 198.51.100.0/30 10.1.1.1 0 100 0 65002 i
*>i 198.51.100.4/30 10.1.1.1 0 100 0 65004 i
*>i 203.0.113.0/30 10.1.1.1 0 100 0 65002 i

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


*>i 203.0.113.4/30 10.1.1.1 0 100 0 65004 i
R1#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/6/9 msa
R1#

It looks like we finally have full reachability throughout our network.

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


Peer Group DEMO
Let’s now optimize and tweak our configuration a bit. In this example, we have a fairly small topology. However,
imagine we had dozens and dozens of routers interconnected, all running BGP. If we started applying a bunch of
policies, like how we’re doing route summarization or how we’re filtering routes, to every single neighbor on a
router that had lots of neighbors, that router’s CPU could take a serious hit.

However, in many cases, we might have a router that is peering with multiple neighbors, and it wants to apply the
same policy to ALL of those neighbors. Instead of doing that on a one-by-one configuration basis, we can configure
PEER GROUPS. This will not only reduce our configuration burden, but it will also reduce the CPU load on our
router.

In this example, let’s say that router R3 wants to make sure it’s not receiving network advertisements for private IP
addresses (RFC 1918 addresses) from one of its ISPs. It could do that through the use of a Prefix List applied to
each neighbor. However, to illustrate the configuration of Peer Groups, let’s apply that Prefix List, not to each
neighbor individually, but to the Peer Group, containing both routers ISP1 and ISP2.

I’ve already created the Prefix List, and since that’s a bit off-topic for today’s discussion, we won’t get into all of the
syntax. Instead, let me just show it to you:

R3:

R3#show ip prefix-list
ip prefix-list BGP-DEMO: 5 entries
seq 5 deny 10.0.0.0/8 le 32
seq 10 deny 172.16.0.0/12 le 32
seq 15 deny 192.168.0.0/16 le 32
seq 20 permit 0.0.0.0/0
seq 25 permit 0.0.0.0/0 ge 8

Now, let’s go into router R3, and define a Peer Group, apply this Prefix List (in the incoming direction, because we
don’t want to learn private IP addresses from our ISPs) to the Peer Group, and finally, we’ll tell each of our
neighbors they each belong to the peer group.

R3#conf term
R3(config)#router bgp 65001
R3(config-router)#neighbor BGP-PG peer-group
R3(config-router)#neighbor BGP-PG prefix-list BGP-DEMO in
R3(config-router)#neighbor 198.51.100.2 peer-group BGP-PG
R3(config-router)#neighbor 198.51.100.6 peer-group BGP-PG
R3(config-router)#end

Now, when we’re filtering incoming routes, identifying any routes that should not be permitted to come in, we
don’t have to do it individually for each neighbor. We just do it once for the entire Peer Group, because our ISP
routers belong to the same Peer Group.

Before, moving on, we want to get rid of the Peer Group, because it’s not going to be compatible with the final
thing we want to do, which is treat our ISPs very differently, instead of the same.

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


R3#conf term
R3(config)#router bgp 65001
R3(config-router)#no neighbor BGP-PG peer-group
R3(config-router)#neighbor 198.51.100.2 remote-as 65002
R3(config-router)#neighbor 198.51.100.6 remote-as 65004
R3(config-router)#end
R3#clear ip bgp *

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


Influencing Path Selection DEMO
R3:
R3#show ip bgp

It looks like we’re currently going to a next hop IP address of 198.51.100.2 to get to our generic Internet address of
5.5.5.5. We talked earlier about how BGP makes its path selection, and it is not at all based on available
bandwidth. In fact, what’s happening here is R3 is choosing to use ISP1, because ISP1 has a lower Router ID
(4.4.4.4) as compared to ISP2’s Router ID (6.6.6.6).

And for the same reason, if traffic is trying to get back into the “Enterprise network” from the Internet, it will be
going over the “slower” ISP1 link down to router R3. Let’s prove that:

INET:
INET#show ip bgp
BGP table version is 49, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
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


*> 5.5.5.0/24 0.0.0.0 0 32768 i
* 10.1.1.0/24 203.0.113.6 0 65004 65001 i
*> 203.0.113.1 0 65002 65001 i
* 172.16.1.0/24 203.0.113.6 0 65004 65001 i
*> 203.0.113.1 0 65002 65001 i
*> 198.51.100.0/30 203.0.113.1 0 0 65002 i
*> 198.51.100.4/30 203.0.113.6 0 0 65004 i
* 203.0.113.0/30 203.0.113.1 0 0 65002 i
*> 0.0.0.0 0 32768 i
* 203.0.113.4/30 203.0.113.6 0 0 65004 i
*> 0.0.0.0 0 32768 i
INET#

Let’s now take a look at how we can influence both outbound and inbound path selection.

There are different ways that we could do this, based on how BGP makes it path selection decisions. However, let’s
assume we’re not allowed to do any configuration on routers ISP1 or ISP2. After all, they belong to the ISP. So, we
want to limit our configuration to router R3.

First, let’s focus on outbound path selection going out to the Internet. I like to use the Local Preference path
attribute. What we can do is apply different Local Preference values to routes coming into R3 from ISP1 and ISP2.
HIGHER Local Preference values are preferred. So, we’ll assign higher Local Preference values to routes learned
from ISP2.

Let’s assign Local Preference values of 100 to routes learned from ISP1 and Local Preference values of 200 learned
from ISP2.

R3#conf term

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


R3(config)#route-map LOCALPREF-ISP1
R3(config-route-map)#set local-preference 100
R3(config-route-map)#exit
R3(config)#route-map LOCALPREF-ISP2
R3(config-route-map)#set local-preference 200
R3(config-route-map)#exit
R3(config)#router bgp 65001
R3(config-router)# neighbor 198.51.100.2 route-map LOCALPREF-ISP1 in
R3(config-router)#neighbor 198.51.100.6 route-map LOCALPREF-ISP2 in

That approach will NOT work, however, for inbound path selection, meaning the path that devices living on the
Internet will take to come into our Enterprise network. The reason is, we would have had to configure this type of
thing on the ISP routers, and we’re not allowed to do that.

So, I suggest that we EXAGERTE the length of the AS path that must be traveled to come into our network via ISP1.
Check this out:

R3(config-router)#exit
R3(config)#route-map ASPATH
R3(config-route-map)#set as-path prepend 65001 65001
R3(config-route-map)#router bgp 65001
R3(config-router)#neighbor 198.51.100.2 route-map ASPATH out
R3(config-router)#end
R3#clear ip bgp *

Now, let’s check out our outbound path selection:


R3#show ip bgp
BGP table version is 8, 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, 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


* 5.5.5.0/24 198.51.100.2 100 0 65002 65003 i
*> 198.51.100.6 200 0 65004 65003 i
* i 10.1.1.0/24 10.1.1.2 0 100 0 i
*> 0.0.0.0 0 32768 i
*>i 172.16.1.0/24 10.1.1.2 0 100 0 i
r 198.51.100.0/30 198.51.100.2 0 100 0 65002 i
r> 198.51.100.6 200 0 65004 65003 65002 i
r 198.51.100.4/30 198.51.100.2 100 0 65002 65003 65004 i
r> 198.51.100.6 0 200 0 65004 i
* 203.0.113.0/30 198.51.100.2 0 100 0 65002 i
*> 198.51.100.6 200 0 65004 65003 i
* 203.0.113.4/30 198.51.100.2 100 0 65002 65003 i
Network Next Hop Metric LocPrf Weight Path
*> 198.51.100.6 0 200 0 65004 i
R3#

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


We’re now going to the Internet via ISP2, because routes learned from ISP2 have a higher Local Preference, as
compared to the routes from ISP1.

Finally, let’s check out our inbound path selection, from the perspective of our Internet router:

INET#show ip bgp
BGP table version is 18, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
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


*> 5.5.5.0/24 0.0.0.0 0 32768 i
*> 10.1.1.0/24 203.0.113.6 0 65004 65001 i
* 203.0.113.1 0 65002 65001 65001 65001
i
*> 172.16.1.0/24 203.0.113.6 0 65004 65001 i
* 203.0.113.1 0 65002 65001 65001 65001
i
*> 198.51.100.0/30 203.0.113.1 0 0 65002 i
*> 198.51.100.4/30 203.0.113.6 0 0 65004 i
*> 203.0.113.0/30 0.0.0.0 0 32768 i
* 203.0.113.1 0 0 65002 i
*> 203.0.113.4/30 0.0.0.0 0 32768 i
* 203.0.113.6 0 0 65004 i
INET#

From the perspective of the Internet, it’s better to come into our Enterprise network via ISP2, because the AS Path
via ISP1 is longer (because we artificially lengthened that AS Path).

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


BGP Address Families DEMO

Next, let’s see how we can route IPv6 networks using Multiprotocol BGP. Remembering that BGP sets up a TCP
session, the way we’re going to do it is over an IPv4 session. We could also do something similar over an IPv6
session, but we’re going to do this over an IPv4 session.

To begin, let’s enable IPv6 routing on routers R3 and ISP2, and remove the existing BGP configuration on those
routers. We’ll then setup a loopback interface on each router, each with an IPv6 address, and we’ll verify those
routers can exchange IPv6 routes.

R3:
R3#conf term
R3(config)#ipv6 unicast-routing
R3(config)#int lo1
R3(config-if)#ipv6 address 2000:1::1/64
R3(config-if)#int gig 0/3
R3(config-if)#ipv6 address 2000:2::1/64

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


R3(config-if)#exit
R3(config)#no router bgp 65001
R3#

ISP2:

ISP2#conf term
ISP2(config)#ipv6 unicast-routing
ISP2(config)#int lo1
ISP2(config-if)#ipv6 address 2000:3::1/64
ISP2(config-if)#int gig 0/1
ISP2(config-if)#ipv6 address 2000:2::2/64
ISP2(config-if)#exit
ISP2(config)#no router bgp 65004
ISP2#

Now, let’s setup BGP to route IPv6 networks over an IPv4 session.

R3:
R3#conf term

First, we want to create a route map that will advertise our egress interface’s IPv6 address as the next-hop IPv6
address on routes we’re advertising out of that interface.

R3(config)#route-map IPV6-NEXT-HOP
R3(config-route-map)#set ipv6 next-hop 2000:2::1
R3(config-route-map)#exit

Next, we begin configuring Multiprotocol BGP much like we previously configured BGP to support the routing of
just IPv4 networks.

R3(config)#router bgp 65001


R3(config-router)#neighbor 198.51.100.6 remote-as 65004

Here’s where it starts to differ though. We create a couple of address families, one for IPv4 and one for IPv6

R3(config-router)#address-family ipv4
R3(config-router-af)#network 10.1.1.0 mask 255.255.255.0
R3(config-router-af)#exit
R3(config-router)#address-family ipv6
R3(config-router-af)#network 2000:1::/64

When we configured the IPv4 address family, our specified neighbor was automatically activated. However, we
have to manually do for our IPv6 address family. Also, we’ll want to associate our previously configured route map,
so the ISP2 router will know the next-hop IPv6 address to use for IPv6 routes that R3 advertises to ISP2.

R3(config-router-af)#neighbor 198.51.100.6 activate

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


R3(config-router-af)#neighbor 198.51.100.6 route-map IPV6-NEXT-
HOP out
R3(config-router-af)#end
R3#

Now, we give a mirror configuration on router ISP2.

ISP2:

ISP2#conf term
ISP2(config)#route-map IPV6-NEXT-HOP
ISP2(config-route-map)#set ipv6 next-hop 2000:2::2
ISP2(config-route-map)#exit
ISP2(config)#router bgp 65004
ISP2(config-router)#neighbor 198.51.100.5 remote-as 65001
ISP2(config-router)#address-family ipv4
ISP2(config-router-af)#network 203.0.113.4 mask 255.255.255.252
ISP2(config-router-af)#exit
ISP2(config-router)#address-family ipv6
ISP2(config-router-af)#network 2000:3::/64
ISP2(config-router-af)#neighbor 198.51.100.5 activate
ISP2(config-router-af)#neighbor 198.51.100.5 route-map IPV6-
NEXT-HOP out
ISP2(config-router-af)#end
ISP2#

Next, let’s do some verification, for both IPv4 and IPv6 networks.

ISP2#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

10.0.0.0/24 is subnetted, 1 subnets


B 10.1.1.0 [20/0] via 198.51.100.5, 00:36:58
198.51.100.0/24 is variably subnetted, 2 subnets, 2 masks
C 198.51.100.4/30 is directly connected, GigabitEthernet0/1
L 198.51.100.6/32 is directly connected, GigabitEthernet0/1
203.0.113.0/24 is variably subnetted, 2 subnets, 2 masks
C 203.0.113.4/30 is directly connected, GigabitEthernet0/2
L 203.0.113.6/32 is directly connected, GigabitEthernet0/2

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)


ISP2#show ipv6 route
IPv6 Routing Table - default - 6 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP
H - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
IS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMO
ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect
RL - RPL, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1
OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
la - LISP alt, lr - LISP site-registrations, ld - LISP dyn-eid
lA - LISP away, a - Application
B 2000:1::/64 [20/0]
via FE80::F816:3EFF:FE05:D5B9, GigabitEthernet0/1
C 2000:2::/64 [0/0]
via GigabitEthernet0/1, directly connected
L 2000:2::2/128 [0/0]
via GigabitEthernet0/1, receive
C 2000:3::/64 [0/0]
via Loopback1, directly connected
L 2000:3::1/128 [0/0]
via Loopback1, receive
L FF00::/8 [0/0]
via Null0, receive
ISP2#show ip bgp
BGP table version is 5, local router ID is 203.0.113.6
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal,
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


*> 10.1.1.0/24 198.51.100.5 0 0 65001 i
*> 203.0.113.4/30 0.0.0.0 0 32768 i

ISP2#show bgp ipv6 unicast


BGP table version is 5, local router ID is 203.0.113.6
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal,
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


*> 2000:1::/64 2000:2::1 0 0 65001 i
*> 2000:3::/64 :: 0 32768 i
ISP2#

Another configuration option is to go into the IPv6 address family configuration mode and point to the remote
neighbor’s IPv6 address. If we do that, we don’t have to worry about creating the route map to specify a next-hop
IPv6 address. However, we’re increasing the number of required neighborships (i.e. we need neighborships for
both IPv4 and IPv6).

Copyright 2022, Kevin Wallace Training, LLC (kwtrain.com)

You might also like