Saturday, May 9, 2015

400-101: BGP, Part V

3.7f Implement and troubleshoot MP-BGP


3.7f(i) IPv4, IPv6, VPN address-family


BGP has multi-protocol capability. In a single session, BGP can carry multiple routed protocols (IPv4 unicast, IPv4 multicast, IPv6 unicast, IPv6 multicast, VPNv4, and so on). These are called "address families". However, a method is needed to tell BGP which address families should be exchanged with a particular neighbor. Defining a neighbor under a particular address family means that the router wants to exchange routes from the particular address family with the neighbor(s) listed there. Neighbors are automatically added to the "invisible" address-family ipv4 section. Different address families can be exchanged with the same neighbor.

BGP uses capability negotiation to confirm that the peer supports the required address families. These capabilites include different values for AFI and SAFI. Both routers must support a capability to use it. The capability is advertised in Open messages.

The bgp upgrade-cli will convert the BGP configuration to the address family style of configuration. Basic BGP peering settings are configured outside the address family scopes. The per-address-family configuration is naturally moved under the address family itself. BGP operation does not change with this new style of configuration, only the configuration format.

The no bgp default ipv4-unicast command will prevent BGP from automatically assigning each newly defined neighbor into the address-family ipv4 section.


1. address-family ipv4

Example: IBGP configuration between R1 and R2 in AS 100.

R1#
interface Loopback10
 ip address 10.1.1.1 255.255.255.0
!
interface Loopback11
 ip address 11.1.1.1 255.255.255.0
!
interface Loopback12
 ip address 12.1.1.1 255.255.255.0
!
interface Loopback13
 ip address 13.1.1.1 255.255.255.0
!
interface FastEthernet0/0.123
 encapsulation dot1Q 123
 ip address 155.1.123.1 255.255.255.0
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 10.1.1.0 mask 255.255.255.0
 network 11.1.1.0 mask 255.255.255.0
 network 12.1.1.0 mask 255.255.255.0
 network 13.1.1.0 mask 255.255.255.0
 neighbor 155.1.123.2 remote-as 100
 no auto-summary



Upgrading the CLI.

R1(config-router)#bgp upgrade-cli
You are about to upgrade to the AFI syntax of bgp commands

Are you sure ? [yes]:



After the upgrade, the configuration looks slightly different. The networks are advertised under the address family, and the neighbor is activated there.

R1#
router bgp 100
 bgp log-neighbor-changes
 neighbor 155.1.123.2 remote-as 100
 !
 address-family ipv4
  neighbor 155.1.123.2 activate
  no auto-summary
  no synchronization
  network 10.1.1.0 mask 255.255.255.0
  network 11.1.1.0 mask 255.255.255.0
  network 12.1.1.0 mask 255.255.255.0
  network 13.1.1.0 mask 255.255.255.0
 exit-address-family



2. address-family ipv6

To advertise IPv6 routes, a new address family is simply added.

R1#
interface Loopback6
 no ip address
 ipv6 address 2001:1111::1/64
!
ipv6 unicast-routing
!
router bgp 100
 bgp log-neighbor-changes
 neighbor 155.1.123.2 remote-as 100
 !
 address-family ipv4
  neighbor 155.1.123.2 activate
  no auto-summary
  no synchronization
  network 10.1.1.0 mask 255.255.255.0
  network 11.1.1.0 mask 255.255.255.0
  network 12.1.1.0 mask 255.255.255.0
  network 13.1.1.0 mask 255.255.255.0
 exit-address-family
 !
 address-family ipv6
  neighbor 155.1.123.2 activate
  network 2001:1111::/64
 exit-address-family



R2#
router bgp 100
 bgp log-neighbor-changes
 neighbor 155.1.123.1 remote-as 100
 !
 address-family ipv4
  neighbor 155.1.123.1 activate
  no auto-summary
  no synchronization
 exit-address-family
 !
 address-family ipv6
  neighbor 155.1.123.1 activate
 exit-address-family



R2's BGP table for IPv6

R2#show bgp ipv6 unicast
BGP table version is 1, local router ID is 150.1.2.2
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
* i2001:1111::/64   ::FFFF:155.1.123.1
                                             0    100      0 i



3. address-family vpnv4

The BGP VPNv4 address family is commonly used with MPLS VPNs. Because PE routers can learn the same prefixes from different customers (CEs), a method to uniquely identify each route is needed. This is done with a route distinguisher (RD), which adds a 8-byte value to an IPv4 prefix - creating a VPNv4 prefix. The RD is specified inside the VRF. In addition to the RD, BGP uses a route target (an extended community) to control the import and export of the routes.

The route distinguisher and the route target can have the same value. If the route target values are different for import and export, they need to match on the neighbor accordingly. The value is typically represented in the format AS:NN (as demonstrated below).

R1(config-vrf)#rd ?
  ASN:nn or IP-address:nn  VPN Route Distinguisher



First, the VRFs are configured. Note that CUSTOMER-ONE is using 65000:1 for export and 65000:11 for import (vice versa on R2). CUSTOMER-TWO is using 65000:2 for both.

R1#
ip vrf CUSTOMER-ONE
 rd 65000:1
 route-target export 65000:1
 route-target import 65000:11
!
ip vrf CUSTOMER-TWO
 rd 65000:2
 route-target both 65000:2
!
interface Loopback1
 ip vrf forwarding CUSTOMER-ONE
 ip address 1.1.1.1 255.255.255.0
!
interface Loopback2
 ip vrf forwarding CUSTOMER-TWO
 ip address 2.2.2.2 255.255.255.0



R2#
ip vrf CLIENT-ONE
 rd 65000:1
 route-target export 65000:11
 route-target import 65000:1
!
ip vrf CLIENT-TWO
 rd 65000:2
 route-target export 65000:2
 route-target import 65000:2
!
interface Loopback11
 ip vrf forwarding CLIENT-ONE
 ip address 11.11.11.11 255.255.255.0
!
interface Loopback22
 ip vrf forwarding CLIENT-TWO
 ip address 22.22.22.22 255.255.255.0



VRF verification on R1.

R1#show ip vrf brief
  Name                             Default RD          Interfaces
  CUSTOMER-ONE                     65000:1             Lo1
  CUSTOMER-TWO                     65000:2             Lo2


R1#show ip vrf interfaces
Interface       IP-Address      VRF               Protocol
Lo1             1.1.1.1         CUSTOMER-ONE      up
Lo2             2.2.2.2         CUSTOMER-TWO      up



VRF verfication on R2.

R2#show ip vrf brief
  Name                             Default RD          Interfaces
  CLIENT-ONE                       65000:1             Lo11
  CLIENT-TWO                       65000:2             Lo22

R2#show ip vrf interfaces
Interface     IP-Address      VRF            Protocol
Lo11          11.11.11.11     CLIENT-ONE     up
Lo22          22.22.22.22     CLIENT-TWO     up



Next, BGP is set up.

R1#
interface FastEthernet0/0
 ip address 10.1.12.1 255.255.255.0
!
router bgp 65000
 bgp log-neighbor-changes
 neighbor 10.1.12.2 remote-as 65000
 !
 address-family ipv4
  neighbor 10.1.12.2 activate
  no auto-summary
  no synchronization
 exit-address-family
 !
 address-family vpnv4
  neighbor 10.1.12.2 activate
  neighbor 10.1.12.2 send-community both
 exit-address-family
 !
 address-family ipv4 vrf CUSTOMER-TWO
  no synchronization
  network 2.2.2.0 mask 255.255.255.0
 exit-address-family
 !
 address-family ipv4 vrf CUSTOMER-ONE
  no synchronization
  network 1.1.1.0 mask 255.255.255.0
 exit-address-family



R2#
interface FastEthernet0/0
 ip address 10.1.12.2 255.255.255.0
!
router bgp 65000
 bgp log-neighbor-changes
 neighbor 10.1.12.1 remote-as 65000
 !
 address-family ipv4
  neighbor 10.1.12.1 activate
  no auto-summary
  no synchronization
 exit-address-family
 !
 address-family vpnv4
  neighbor 10.1.12.1 activate
  neighbor 10.1.12.1 send-community both
 exit-address-family
 !
 address-family ipv4 vrf CLIENT-TWO
  no synchronization
  network 22.22.22.0 mask 255.255.255.0
 exit-address-family
 !
 address-family ipv4 vrf CLIENT-ONE
  no synchronization
  network 11.11.11.0 mask 255.255.255.0
 exit-address-family



Note the VPNv4 capability.

R2#show ip bgp neighbor
BGP neighbor is 10.1.12.1,  remote AS 65000, internal link
  BGP version 4, remote router ID 150.1.1.1
  BGP state = Established, up for 00:00:15
  Last read 00:00:15, last write 00:00:15, hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received
    Address family VPNv4 Unicast: advertised and received



BGP is learning VPNv4 routes.

R1#show ip bgp vpnv4 vrf CUSTOMER-ONE
BGP table version is 9, local router ID is 150.1.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
Route Distinguisher: 65000:1 (default for vrf CUSTOMER-ONE)
*> 1.1.1.0/24       0.0.0.0                  0         32768 i
*>i11.11.11.0/24    10.1.12.2                0    100      0 i



R1#show ip bgp vpnv4 vrf CUSTOMER-TWO
BGP table version is 9, local router ID is 150.1.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
Route Distinguisher: 65000:2 (default for vrf CUSTOMER-TWO)
*> 2.2.2.0/24       0.0.0.0                  0         32768 i
*>i22.22.22.0/24    10.1.12.2                0    100      0 i



R2 is also seeing the routes advertised by R1.

R2#show ip bgp vpnv4 vrf CLIENT-ONE
BGP table version is 9, local router ID is 150.1.2.2
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
Route Distinguisher: 65000:1 (default for vrf CLIENT-ONE)
*>i1.1.1.0/24       10.1.12.1                0    100      0 i
*> 11.11.11.0/24    0.0.0.0                  0         32768 i
R2#


 

R2#show ip bgp vpnv4 vrf CLIENT-TWO
BGP table version is 9, local router ID is 150.1.2.2
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
Route Distinguisher: 65000:2 (default for vrf CLIENT-TWO)
*>i2.2.2.0/24       10.1.12.1                0    100      0 i
*> 22.22.22.0/24    0.0.0.0                  0         32768 i



P.S. Note that this is not how you would normally configure MP-BGP for MPLS VPNs. This post is simply demonstrating the use of BGP VPNv4 address family.

No comments:

Post a Comment