Dynamic Routing with MBGP
Problem
You want to use MBGP to carry IPv6 routing information between autonomous systems.
Solution
MBGP readily carries IPv6 unicast routing information between IPv6 BGP peers:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#router bgp 65520
Router1(config-router)#no bgp default ipv4-unicast
Router1(config-router)#neighbor AAAA:5::2 remote-as 65522
Router1(config-router)#neighbor AAAA:5::AA9 remote-as 65521
Router1(config-router)#address-family ipv6
Router1(config-router-af)#neighbor AAAA:5::2 activate
Router1(config-router-af)#neighbor AAAA:5::AA9 activate
Router1(config-router-af)#network AAAA:2222::2/64
Router1(config-router-af)#no synchronization
Router1(config-router-af)#exit-address-family
Router1(config-router)#exit
Router1(config)#end
Router1#
And you can even run a combination of IPv4 and IPv6 BGP on the same router:
Router9#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router9(config)#router bgp 65521
Router9(config-router)#no bgp default ipv4-unicast
Router9(config-router)#neighbor AAAA:5::1 remote-as 65520
Router9(config-router)#neighbor 192.168.1.103 remote-as 65525
Router9(config-router)#address-family ipv4
Router9(config-router-af)#redistribute connected
Router9(config-router-af)#neighbor 192.168.1.103 activate
Router9(config-router-af)#no auto-summary
Router9(config-router-af)#no synchronization
Router9(config-router-af)#exit-address-family
Router9(config-router)#address-family ipv6
Router9(config-router-af)#neighbor AAAA:5::1 activate
Router9(config-router-af)#network AAAA:FE::1/64
Router9(config-router-af)#network AAAA:BBBB::1/64
Router9(config-router-af)#no synchronization
Router9(config-router-af)#exit-address-family
Router9(config-router)#exit
Router9(config)#end
Router9#
Discussion
The first example shows how to configure a router to run BGP between IPv6 peers:
Router1(config)#router bgp 65520
Router1(config-router)#no bgp default ipv4-unicast
Router1(config-router)#neighbor AAAA:5::2 remote-as 65522
The critical command here is the no bgp default ipv4-unicast line. By default, BGP will only distribute IPv4 prefixes to its neighbors. However, when you disable the default ipv4-unicast command, you can start to distribute IPv6 routing information as well.
We note in passing that you can configure IPv4 neighbors to pass IPv6 routing information, but this quickly becomes very complicated because the next-hop information is in the wrong protocol. For this reason, we strongly recommend using IPv6 neighbor addresses when passing IPv6 routing prefixes with MBGP.
The next step is to configure one or more neighbor statements and to activate them in the address-family ipv6 configuration block. This way the router knows what sorts of Network Layer Reachability Information (NLRI) to pass to this neighbor. You also configure any network commands in the address-family configuration area:
Router1(config)#router bgp 65520
Router1(config-router)#neighbor AAAA:5::2 remote-as 65522
Router1(config-router)#address-family ipv6
Router1(config-router-af)#neighbor AAAA:5::2 activate
Router1(config-router-af)#network AAAA:2222::2/64
Router1(config-router-af)#no synchronization
Note that we have included the no synchronization command here for the same reasons that we included it in many of the BGP examples in Chapter 9. By default, BGP wants to ensure that all routing is consistent within the Autonomous System. So it wants to see that any prefixes that it distributes using iBGP are also present in the IGP for the AS. In this example, however, we are not redistributing routing information between BGP and the IGP. In fact, we're not even running an IGP. Please refer to Chapter 9 for a more detailed discussion of this command.
In the second example in the Solution section of this recipe, we have configured both IPv4 and IPv6 BGP neighbors:
Router9#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router9(config)#router bgp 65521
Router9(config-router)#no bgp default ipv4-unicast
Router9(config-router)#neighbor AAAA:5::1 remote-as 65520
Router9(config-router)#neighbor 192.168.1.103 remote-as 65525
Then we have included address-family configuration both IPv4 and IPv6 unicast route prefixes:
Router9(config-router)#address-family ipv4
Router9(config-router-af)#redistribute connected
Router9(config-router-af)#neighbor 192.168.1.103 activate
Router9(config-router-af)#no auto-summary
Router9(config-router-af)#no synchronization
Router9(config-router-af)#exit-address-family
Router9(config-router)#address-family ipv6
Router9(config-router-af)#neighbor AAAA:5::1 activate
Router9(config-router-af)#network AAAA:FE::1/64
Router9(config-router-af)#network AAAA:BBBB::1/64
Router9(config-router-af)#no synchronization
Router9(config-router-af)#exit-address-family
This means that this router is running BGP for both IPv4 and IPv6 simultaneously. Note that when you do this, the ASN for both protocols is the same.
The commands to look at IPv6 BGP information are slightly different that we previously saw for IPv4 BGP. You can see the status of the neighbor routers with the show bgp summary command:
Router9#show bgp summary
BGP router identifier 172.16.1.1, local AS number 65521
BGP table version is 19, main routing table version 19
6 network entries using 798 bytes of memory
6 path entries using 432 bytes of memory
4 BGP path attribute entries using 240 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 1518 total bytes of memory
BGP activity 58/50 prefixes, 112/104 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
AAAA:5::1 4 65520 168 147 19 0 0 01:44:39 4
Router9#
You still use the show ip bgp summary command to see the pure IPv4 BGP peers:
Router9#show ip bgp summary
BGP router identifier 172.16.1.1, local AS number 65521
BGP table version is 12, main routing table version 12
5 network entries using 505 bytes of memory
6 path entries using 288 bytes of memory
5 BGP path attribute entries using 300 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
BGP using 1165 total bytes of memory
BGP activity 61/50 prefixes, 116/104 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.1.103 4 65525 83 83 12 0 0 00:01:43 4
Router9#
To look at the BGP table, which contains all BGP routing prefixes, you use the show bgp command:
Router9#show bgp
BGP table version is 19, local router ID is 172.16.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> AAAA:99::A:0/112 AAAA:5::2 0 65520 65522 65523 i
*> AAAA:99::B:0/112 AAAA:5::2 0 65520 65522 65523 i
*> AAAA:99::C:0/112 AAAA:5::2 0 65520 65522 65523 i
*> AAAA:FE::1/64 :: 0 32768 i
*> AAAA:2222::/64 AAAA:5::1 0 0 65520 i
*> AAAA:BBBB::/64 :: 0 32768 i
Router9#
And you can verify that these IPv6 prefixes have been imported into the routing table with the command show ipv6 route bgp:
Router9#show ipv6 route bgp
IPv6 Routing Table - 20 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
B AAAA:99::A:0/112 [20/0]
via AAAA:5::2
B AAAA:99::B:0/112 [20/0]
via AAAA:5::2
B AAAA:99::C:0/112 [20/0]
via AAAA:5::2
B AAAA:2222::/64 [20/0]
via FE80::20E:D7FF:FED6:4D80, Ethernet0
Router9#