BGP Demo Scripts
BGP Demo Scripts
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
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
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
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
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
R2:
R2#conf term
R2(config)#router bgp 65200
R2(config-router)#synchronization
R2(config-router)#end
R2#clear ip bgp *
R2#
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
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
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
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
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
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
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
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
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,
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
This confirms that R1 and R3 are eBGP neighbors, even though they’re not physically adjacent.
Setup
R1:
ena
conf t
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
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
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
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
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#
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
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
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
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,
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
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
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:
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 *
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
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.
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
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
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 *
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
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).
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
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.
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.
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
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).