Multiprotocol BGP (MP-BGP) Configuration

The normal version of BGP (Border Gateway Protocol) only supported IPv4 unicast prefixes. Nowadays we use MP-BGP (Multiprotocol BGP) which supports different addresses:

  • IPv4 unicast
  • IPv4 multicast
  • IPv6 unicast
  • IPv6 multicast

MP-BGP is also used for MPLS VPN where we use MP-BGP to exchange the VPN labels. For each different “address” type, MP-BGP uses a different address family.

To allow these new addresses, MBGP has some new features that the old BGP doesn’t have:

  • Address Family Identifier (AFI): specifies the address family.
  • Subsequent Address Family Identifier (SAFI): Has additional information for some address families.
  • Multiprotocol Unreachable Network Layer Reachability Information (MP_UNREACH_NLRI): This is an attribute used to transport networks that are unreachable.
  • BGP Capabilities Advertisement: This is used by a BGP router to announce to the other BGP router what capabilities it supports. MP-BGP and BGP-4 are compatible, the BGP-4 router can ignore the messages that it doesn’t understand.

Since MP-BGP supports IPv4 and IPv6 we have a couple of options. MP-BGP routers can become neighbors using IPv4 addresses and exchange IPv6 prefixes or the other way around. Let’s take a look at some configuration examples…

Configuration

MP-BGP with IPv6 adjacency & IPv6 prefixes

Let’s start with a simple example where we use IPv6 for the neighbor adjacency and exchange some IPv6 prefixes. Here’s the topology I will use:

MP BGP R1 R2

Here’s the configuration of R1:

R1(config)#router bgp 1
R1(config-router)#neighbor 2001:db8:0:12::2 remote-as 2
R1(config-router)#address-family ipv4
R1(config-router-af)#no neighbor 2001:db8:0:12::2 activate
R1(config-router-af)#exit
R1(config-router)#address-family ipv6
R1(config-router-af)#neighbor 2001:db8:0:12::2 activate
R1(config-router-af)#network 2001:db8::1/128

In the configuration above we first specify the remote neighbor. The address-family command is used to change the IPv4 or IPv6 settings. I disable the IPv4 address-family and enabled IPv6. Last but not least, we advertised the prefix on the loopback interface. The configuration of R2 looks similar:

R2(config)#router bgp 2
R2(config-router)#neighbor 2001:db8:0:12::1 remote-as 1
R2(config-router)#address-family ipv4
R2(config-router-af)#no neighbor 2001:db8:0:12::1 activate
R2(config-router-af)#exit
R2(config-router)#address-family ipv6
R2(config-router-af)#neighbor 2001:db8:0:12::1 activate
R2(config-router-af)#network 2001:db8::2/128

After awhile the neighbor adjacency will appear:

R1#
%BGP-5-ADJCHANGE: neighbor 2001:DB8:0:123::2 Up

Now let’s check the routing tables:

R1#show ipv6 route bgp
IPv6 Routing Table - default - 7 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       D - EIGRP, EX - EIGRP external, NM - NEMO, ND - Neighbor Discovery
       l - LISP
       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   2001:DB8::2/128 [20/0]
     via FE80::217:5AFF:FEED:7AF0, FastEthernet0/0
R2#show ipv6 route bgp
IPv6 Routing Table - default - 7 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       D - EIGRP, EX - EIGRP external, NM - NEMO, ND - Neighbor Discovery
       l - LISP
       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   2001:DB8::1/128 [20/0]
     via FE80::21D:A1FF:FE8B:36D0, FastEthernet0/0

The routers learned each others prefixes…great! This example was pretty straight-forward but you have now learned how MP-BGP uses different address families.

Configurations

Want to take a look for yourself? Here you will find the final configuration of each device.

R1

hostname R1
!
interface Loopback 0
 ipv6 enable
 ipv6 address 2001:DB8::1/128
!
interface fastEthernet0/0
 ipv6 enable
 ipv6 address 2001:DB8:0:12::1/64
!
router bgp 1
 bgp log-neighbor-changes
 neighbor 2001:DB8:0:12::2 remote-as 2
 !        
 address-family ipv4
  no neighbor 2001:DB8:0:12::2 activate
 exit-address-family
 !
 address-family ipv6
  network 2001:DB8::1/128
  neighbor 2001:DB8:0:12::2 activate
 exit-address-family
!
end

R2

hostname R2
!
interface Loopback 0
 ipv6 enable
 ipv6 address 2001:DB8::2/128
!
interface fastEthernet0/0
 ipv6 enable
 ipv6 address 2001:DB8:0:12::2/64
!
router bgp 2
 bgp log-neighbor-changes
 neighbor 2001:DB8:0:12::1 remote-as 1
 !        
 address-family ipv4
  no neighbor 2001:DB8:0:12::1 activate
 exit-address-family
 !
 address-family ipv6
  network 2001:DB8::2/128
  neighbor 2001:DB8:0:12::1 activate
 exit-address-family
!
end

MP-BGP with IPv4 adjacency & IPv6 prefixes

let’s look at a more complex example, the routers will become neighbors through IPv4 but will exchange IPv6 prefixes. I’ll use the same topology but with an IPv4 subnet in between:

MP BGP R1 R2 IPv4 IPv6

Here’s the configuration:

R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.12.2 remote-as 2
R2(config)#router bgp 2
R2(config-router)#neighbor 192.168.12.1 remote-as 1

Now we can configure the address-family for IPv6 unicast:

R1(config)#router bgp 1
R1(config-router)#address-family ipv6
R1(config-router-af)#network 2001:db8::1/128
R1(config-router-af)#neighbor 192.168.12.2 activate
R2(config)#router bgp 2
R2(config-router)#address-family ipv6
R2(config-router-af)#network 2001:db8::2/128
R2(config-router-af)#neighbor 192.168.12.1 activate

Once we enter the address-family IPv6 configuration there are two things we have to configure. The prefix has to be advertised and we need to specify the neighbor. The prefixes on the loopback interface should now be advertised. Let’s check it out:

R1#show ip bgp ipv6 unicast
BGP table version is 2, local router ID is 192.168.12.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, x best-external, f RT-Filter
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 2001:DB8::1/128  ::                       0         32768 i
*  2001:DB8::2/128  ::FFFF:192.168.12.2
                                             0             0 2 i
R2#show ip bgp ipv6 unicast
BGP table version is 2, local router ID is 192.168.12.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, x best-external, f RT-Filter
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  2001:DB8::1/128  ::FFFF:192.168.12.1
                                             0             0 1 i
*> 2001:DB8::2/128  ::                       0         32768 i

As you can see the routers have learned about each others prefixes. There’s one problem though…we were able to exchange IPv6 prefixes but we only use IPv4 between R1 and R2, there is no valid next hop address that we can use.

To fix this, we need to use some IPv6 addresses that we can use as the next hop. We’ll have to configure a prefix between R1 and R2 for this:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 799 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

595 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags:


Forum Replies

  1. Hi Rene,
    Can you please explain why do neighbors need to be activated ? In the old syntax ( without address families) these was no “activate”. After declaring the neighbors they were activated by default ? But in the new format they are “born” not activated so we need to activate them ?
    Thank you.
    BR
    Adrian

  2. Hi Adrian,

    In the “global” configuration mode of BGP we configure IPv4 unicast which is activated by default. All the other stuff like IPv6 unicast/multicast, IPv4 multicast and VPN routes are disabled by default so that’s why we need to activate them. I guess it makes sense, BGP is/was mostly used for IPv4 unicast and not everyone uses all the other address families.

    Rene

  3. Rene, i have a question, on your 1st config on IPv6 adjacency & IPv6 prefixes, you said that
    you disabled the ipv4 address family, so you disabled that by typing the command “no neighbor activate” under the address family IPv4?
    so by default, the IPv4 was activated?
    what will happened if you only typed…

    R1(config)#router bgp 1
    R1(config-router)#neighbor 2001:db8:0:12::2 remote-as 2
    R1(config-router)#address-family ipv6
    R1(config-router-af)#neighbor 2001:db8:0:12::2 activate
    R1(config-router-af)#network 2001:db8::1/128
    

    this is the 1st time i encounter this com

    ... Continue reading in our forum

  4. Hi John,

    MP-BGP supports IPv4 unicast, IPv4 multicast, IPv6 unicast, IPv6 multicast and VPN routes. For each of those, it has an address family.

    By default only the IPv4 unicast address family is activated, the rest is inactive. In the first example I disabled IPv4 unicast since we were only going to do IPv6 unicast.

    Rene

69 more replies! Ask a question or join the discussion by visiting our Community Forum