Configuring Load Balancing Among EBGP and IBGP Routes When CEs Are Dual-Homed



When a CE is dual homed to two PEs, if one PE is in the same AS as the remote PE, whereas the other PE is not in the same AS as the remote PE, you can configure EBGP and IBGP route load balancing.

Networking Requirements

As shown in Figure 1, CE1 and CE2 belong to the same VPN instance. CE1 accesses the network respectively through PE3 in AS 100 and PE2 in AS 200. That is, CE1 is dual-homed to PE3 and PE2. CE2 accesses the network through PE1 in AS 100.
The Inter-AS BGP/MPLS IP VPN is implemented using Option C so that load balancing can be implemented among EBGP and IBGP routes.
Figure 1 Networking diagram of configuring load balancing among EBGP and IBGP routes when CEs are dual-homed

Configuration Roadmap

The configuration roadmap is as follows:
  1. Establish the MP-EBGP peer relationship between the PEs in different ASs. Since the PEs are generally not directly connected, you also need to configure the maximum hops between the PEs for them to set up an EBGP connection.
  2. Configure a routing policy on the ASBR: Allocate MPLS labels to the the routes received by the PE in the local AS before advertising the route to the remote ASBR; allocate new MPLS labels to the labeled IPv4 routes advertised to the PE in the local AS.
  3. Configure the PEs to exchange the labeled IPv4 routes with the ASBRs in the local AS.
  4. Enable the capability of exchanging the labeled IPv4 routes between the local ASBR and the remote ASBR.
  5. In the BGP-VPN instance view of PE1, enable load balancing among EBGP and IBGP routes to CE1.

Data Preparation

To complete the configuration, you need the following data.
  • MPLS LSR IDs of PEs and ASBRs
  • Names of VPN instance created on PEs, RD, and VPN target
  • Routing policies configured on ASBRs
  • Maximum number of EBGP and IBGP routes that perform load balancing

Procedure

  1. Configure IGP on the MPLS backbone networks in AS 100 and AS 200 to implement interconnection between PEs and ASBRs in each MPLS backbone network.
    Take OSPF as an example. The detailed configuration procedure is not mentioned here.
     NOTE:
    Advertise the IP address of the loopback interface used as the LSR-ID through OSPF.
    After the configuration, the OSPF neighbor relationship can be established between the ASBRs and the PEs in the same AS. Running the display ospf peer command, you can find that the neighbor status is Full.
    Take the display on PE2 as an example.
    <PE2> display ospf peer
    
              OSPF Process 1 with Router ID 4.4.4.9
                      Neighbors
    
     Area 0.0.0.0 interface 162.1.1.1(Pos1/0/0)'s neighbors
     Router ID: 3.3.3.9          Address: 162.1.1.2
       State: Full  Mode:Nbr is  Master  Priority: 1
       DR: None   BDR: None   MTU: 0
       Dead timer due in 31  sec
       Neighbor is up for 00:28:11
       Authentication Sequence: [ 0 ]
    
    The ASBRs and the PEs in the same AS can learn the IP address of loopback1 from each other and ping through each other.
  2. Configure basic MPLS functions and MPLS LDP on the MPLS backbone networks of AS 100 and AS 200 to establish LDP LSPs.

  3. Configure the IBGP peer relationship of between AS 100 and AS 200 in the the IPv4 address family view.
    For detailed configurations, see the following configuration files.
  4. Configure the VPN instance on the PEs and configure the CEs to access the VPN instances.
     NOTE:
    VPN-Target attributes of the VPN instances of the PEs in different ASs must match each other.
    For detailed configurations, see the following configuration files.
  5. Enable the capability of exchanging labeled IPv4 routes.

  6. Establish the MP-EBGP peer relationship between PE1 and PE2.
    # Configure PE1.
    [PE1] bgp 100
    [PE1-bgp] peer 4.4.4.9 as-number 200
    [PE1-bgp] peer 4.4.4.9 connect-interface LoopBack 1
    [PE1-bgp] peer 4.4.4.9 ebgp-max-hop 10
    [PE1-bgp] ipv4-family vpnv4
    [PE1-bgp-af-vpnv4] peer 4.4.4.9 enable
    [PE1-bgp-af-vpnv4] quit
    [PE1-bgp] quit
    # Configure PE2.
    [PE2] bgp 200
    [PE2-bgp] peer 1.1.1.9 as-number 100
    [PE2-bgp] peer 1.1.1.9 connect-interface LoopBack 1
    [PE2-bgp] peer 1.1.1.9 ebgp-max-hop 10
    [PE2-bgp] ipv4-family vpnv4
    [PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
    [PE2-bgp-af-vpnv4] quit
    [PE2-bgp] quit
  7. Configure load balancing among EBGP and IBGP routes on PE1.
    # Configure PE1.
    [PE1] bgp 100
    [PE1-bgp] ipv4-family vpn-instance vpn3
    [PE1-bgp-vpn3] load-balancing as-path-ignore
    [PE1-bgp-vpn3] maximum load-balancing eibgp 2
    [PE1-bgp-vpn3] quit
    [PE1-bgp] quit
  8. Verify the configuration.
    After the preceding configurations, you can view that load balancing is performed among EBGP and IBGP routes on PE1.
    <PE1> display ip routing-table vpn-instance vpn3
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: vpn3
             Destinations : 4        Routes : 6
    
    Destination/Mask    Proto  Pre  Cost        Flags NextHop         Interface
    
           10.1.1.0/24  BGP    255  0            RD  5.5.5.9         Pos2/0/0
                        BGP    255  0            RD  4.4.4.9         Pos1/0/0
           10.2.1.0/24  BGP    255  0            RD  4.4.4.9         Pos1/0/0
                        BGP    255  0            RD  5.5.5.9         Pos2/0/0
           10.3.1.0/24  Direct 0    0             D  10.3.1.1        GigabitEthernet3/0/0
           10.3.1.1/32  Direct 0    0             D  127.0.0.1       InLoopBack0
    

Configuration Files

  • Configuration file of PE1
    #
     sysname PE1
    #
    ip vpn-instance vpn3
     ipv4-family
      route-distinguisher 300:1
      vpn-target 1:1 export-extcommunity
      vpn-target 1:1 import-extcommunity
    #
     mpls lsr-id 1.1.1.9
     mpls
    #
    mpls ldp
    #
    interface Pos1/0/0
     link-protocol ppp
     undo shutdown
     ip address 172.1.1.2 255.255.255.0
     mpls
     mpls ldp
    #
    interface GigabitEthernet3/0/0
     undo shutdown
     ip binding vpn-instance vpn3
     ip address 10.3.1.1 255.255.255.0
    #
    interface Pos2/0/0
     link-protocol ppp
     undo shutdown
     ip address 192.2.1.1 255.255.255.0
     mpls
     mpls ldp
    #
    interface LoopBack1
     ip address 1.1.1.9 255.255.255.255
    #
    bgp 100
     peer 2.2.2.9 as-number 100
     peer 2.2.2.9 connect-interface LoopBack1
     peer 4.4.4.9 as-number 200
     peer 4.4.4.9 ebgp-max-hop 10
     peer 4.4.4.9 connect-interface LoopBack1
     peer 5.5.5.9 as-number 100
     peer 5.5.5.9 connect-interface LoopBack1
     #
     ipv4-family unicast
      undo synchronization
      import-route direct
      peer 2.2.2.9 enable
      peer 2.2.2.9 label-route-capability
      peer 4.4.4.9 enable
      peer 5.5.5.9 enable
     #
     ipv4-family vpnv4
      policy vpn-target
      peer 4.4.4.9 enable
      peer 5.5.5.9 enable
     #
     ipv4-family vpn-instance vpn3
      import-route direct
      maximum load-balancing eibgp 2
      load-balancing as-path-ignore
      peer 10.3.1.2 as-number 65002
    #
    ospf 1
     area 0.0.0.0
      network 1.1.1.9 0.0.0.0
      network 172.1.1.0 0.0.0.255
      network 192.2.1.0 0.0.0.255
    #
    return
    
  • Configuration file of ASBR1
    #
     sysname ASBR1
    #
     mpls lsr-id 2.2.2.9
     mpls
    #
    mpls ldp
    #
    interface Pos1/0/0
     link-protocol ppp
     undo shutdown
     ip address 172.1.1.1 255.255.255.0
     mpls
     mpls ldp
    #
    interface Pos2/0/0
     link-protocol ppp
     undo shutdown
     ip address 192.1.1.1 255.255.255.0
     mpls
    #
    interface LoopBack1
     ip address 2.2.2.9 255.255.255.255
    #
    bgp 100
     peer 1.1.1.9 as-number 100
     peer 1.1.1.9 connect-interface LoopBack1
     peer 192.1.1.2 as-number 200
     #
     ipv4-family unicast
      undo synchronization
      network 1.1.1.9 255.255.255.255
      network 172.1.1.0 255.255.255.0
      import-route direct
      peer 1.1.1.9 enable
      peer 1.1.1.9 route-policy policy2 export
      peer 1.1.1.9 label-route-capability
      peer 192.1.1.2 enable
      peer 192.1.1.2 route-policy policy1 export
      peer 192.1.1.2 label-route-capability
    #
    ospf 1
     area 0.0.0.0
      network 2.2.2.9 0.0.0.0
      network 172.1.1.0 0.0.0.255
    #
    route-policy policy1 permit node 1
     apply mpls-label
    #
    route-policy policy2 permit node 1
     if-match mpls-label
     apply mpls-label
    #
    return
    
  • Configuration file of ASBR2
    #
     sysname ASBR2
    #
     mpls lsr-id 3.3.3.9
     mpls
    #
    mpls ldp
    #
    interface Pos1/0/0
     link-protocol ppp
     undo shutdown
     ip address 162.1.1.1 255.255.255.0
     mpls
     mpls ldp
    #
    interface Pos2/0/0
     link-protocol ppp
     undo shutdown
     ip address 192.1.1.2 255.255.255.0
     mpls
    #
    interface LoopBack1
     ip address 3.3.3.9 255.255.255.255
    #
    bgp 200
     peer 4.4.4.9 as-number 200
     peer 4.4.4.9 connect-interface LoopBack1
     peer 192.1.1.1 as-number 100
     #
     ipv4-family unicast
      undo synchronization
      network 4.4.4.9 255.255.255.255
      network 162.1.1.0 255.255.255.0
      import-route direct
      peer 4.4.4.9 enable
      peer 4.4.4.9 route-policy policy4 export
      peer 4.4.4.9 label-route-capability
      peer 192.1.1.1 enable
      peer 192.1.1.1 route-policy policy3 export
      peer 192.1.1.1 label-route-capability
    #
    ospf 1
     area 0.0.0.0
      network 3.3.3.9 0.0.0.0
      network 162.1.1.0 0.0.0.255
    #
    route-policy policy3 permit node 1
     apply mpls-label
    #
    route-policy policy4 permit node 1
     if-match mpls-label
     apply mpls-label
    #
    return
    
  • Configuration file of PE2
    #
     sysname PE2
    #
    ip vpn-instance vpn3
     ipv4-family
      route-distinguisher 300:1
      vpn-target 1:1 export-extcommunity
      vpn-target 1:1 import-extcommunity
    #
     mpls lsr-id 4.4.4.9
     mpls
    #
    mpls ldp
    #
    interface Pos1/0/0
     link-protocol ppp
     undo shutdown
     ip address 162.1.1.2 255.255.255.0
     mpls
     mpls ldp
    #
    interface GigabitEthernet2/0/0
     undo shutdown
     ip binding vpn-instance vpn3
     ip address 10.2.1.1 255.255.255.0
    #
    interface LoopBack1
     ip address 4.4.4.9 255.255.255.255
    #
    bgp 200
     peer 1.1.1.9 as-number 100
     peer 1.1.1.9 ebgp-max-hop 10
     peer 1.1.1.9 connect-interface LoopBack1
     peer 3.3.3.9 as-number 200
     peer 3.3.3.9 connect-interface LoopBack1
     #
     ipv4-family unicast
      undo synchronization
      peer 1.1.1.9 enable
      peer 3.3.3.9 enable
      peer 3.3.3.9 label-route-capability
     #
     ipv4-family vpnv4
      policy vpn-target
      peer 1.1.1.9 enable
     #
     ipv4-family vpn-instance vpn3
      import-route direct
      peer 10.2.1.2 as-number 65001
    #
    ospf 1
     area 0.0.0.0
      network 4.4.4.9 0.0.0.0
      network 162.1.1.0 0.0.0.255
    #      
    return
    
  • Configuration file of PE3
    #
     sysname PE3
    #
    ip vpn-instance vpn3
     ipv4-family
      route-distinguisher 300:1
      vpn-target 1:1 export-extcommunity
      vpn-target 1:1 import-extcommunity
    #
     mpls lsr-id 5.5.5.9
     mpls
    #
    mpls ldp
    #
    interface Pos2/0/0
     link-protocol ppp
     undo shutdown
     ip address 192.2.1.2 255.255.255.0
     mpls
     mpls ldp
    #
    interface GigabitEthernet1/0/0
     undo shutdown
     ip binding vpn-instance vpn3
     ip address 10.1.1.1 255.255.255.0
    #
    interface LoopBack1
     ip address 5.5.5.9 255.255.255.255
    #
    bgp 100
     peer 1.1.1.9 as-number 100
     peer 1.1.1.9 connect-interface LoopBack1
     peer 10.1.1.2 as-number 65001
     #
     ipv4-family unicast
      undo synchronization
      import-route direct
      peer 1.1.1.9 enable
    #
     ipv4-family vpnv4
      policy vpn-target
      peer 1.1.1.9 enable
     #
     ipv4-family vpn-instance vpn3
      import-route direct
      peer 10.1.1.2 as-number 65001
    #
    ospf 1
     area 0.0.0.0
      network 5.5.5.9 0.0.0.0
      network 192.2.1.0 0.0.0.255
    #
    return
    
  • Configuration file of CE1
    #
     sysname CE1
    #
    interface GigabitEthernet1/0/0
     undo shutdown
     ip address 10.1.1.2 255.255.255.0
    #
    interface GigabitEthernet2/0/0
     undo shutdown
     ip address 10.2.1.2 255.255.255.0
    #
    bgp 65001
     peer 10.1.1.1 as-number 100
     peer 10.2.1.1 as-number 200
     #
     ipv4-family unicast
      undo synchronization
      import-route direct
      peer 10.1.1.1 enable
      peer 10.2.1.1 enable
    #
    return
    
  • Configuration file of CE2
    #
     sysname CE2
    #
    interface GigabitEthernet1/0/0
     undo shutdown
     ip address 10.3.1.2 255.255.255.0
    #
    bgp 65002
     peer 10.3.1.1 as-number 100
     #
     ipv4-family unicast
      undo synchronization
      peer 10.3.1.1 enable
    #
    return

No comments:

Post a Comment