How to Configure MPLS Load Balancing
Note Ensure that MPLS is configured.
Note No other specific command needs to be enabled for MPLS Load Balancing to work.
Step 1 Understand MPLS VPN. For more information, see the "Understanding MPLS VPNs" section in the
Configuring MPLS, MPLS VPN, MPLS OAM, and EoMPLS
document.
Step 2 Configure MPLS VPN. For more information, see the "Configuring MPLS VPNs" section in the
Configuring MPLS, MPLS VPN, MPLS OAM, and EoMPLS
document.
Step 3 Enable MPLS. For more information, see the "Enabling MPLS" section in the
Configuring MPLS, MPLS VPN, MPLS OAM, and EoMPLS
document.
Step 4 Define VPN. For more information, see the "Defining VPNs" section in the
Configuring MPLS, MPLS VPN, MPLS OAM, and EoMPLS
document.
Step 5 Configure BGP Routing Sessions. For more information, see the "Configuring BGP Routing Sessions" section in the
Configuring MPLS, MPLS VPN, MPLS OAM, and EoMPLS
document.
Step 6 Configure the Provider-Edge-to-Provider-Edge Routing Sessions. For more information, see the "Configuring the Provider-Edge-to-Provider-Edge Routing Sessions" section in the
Configuring MPLS, MPLS VPN, MPLS OAM, and EoMPLS
document.
Configuration Examples for MPLS Load Balancing
Consider the following topology:
Figure 1 Topology for MPLS Load Balancing
where,
-
CE—customer edge router that is located at the customer premises. The CE provides an Ethernet interface between the customer's LAN and the provider's core network.
-
PE—provider edge router is a router that is located at the edge of a service provider’s network. A PE router is any component capable of a broad range of routing protocol, such as:
– Border Gateway Protocol (BGP)
– Open Shortest Path First (OSPF)
– Multi-Protocol Label Switching (MPLS)
-
P—provider router located in the core of the service provider’s network.
Layer 2 VPN Configuration Example
This example depicts configuration for 129 virtual circuits. See Figure 1 for the following configuration:
At PE1:
ip address 1.1.1.1 255.255.255.255 mpls ldp advertise-labels ip address 5.5.5.1 255.255.0.0 mpls ldp advertise-labels network 5.5.5.1 0.0.0.0 area 0 network 1.1.1.1 0.0.0.0 area 0
-
Configure the service instance from 2 to 129
Note There are multiple MPLS links in the core. The packets are load balanced across the core links based on the L2VPN labels.
switchport trunk allowed vlan none service instance 2 ethernet rewrite ingress tag pop 1 symmetric xconnect 2.2.2.2 2 encapsulation mpls service instance 129 ethernet rewrite ingress tag pop 1 symmetric xconnect 2.2.2.2 129 encapsulation mpls
At P1:
ip address 4.4.4.4 255.255.255.255 mpls ldp advertise-labels ip address 5.5.5.2 255.255.0.0 mpls ldp advertise-labels ip address 90.0.0.1 255.255.0.0 network 4.4.4.4 0.0.0.0 area 0 network 90.0.0.1 0.0.0.0 area 0 network 5.5.5.2 0.0.0.0 area 0 channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active
At P2:
ip address 3.3.3.3 255.255.255.255 ip address 90.0.0.2 255.255.0.0 ip address 100.0.0.2 255.255.0.0 network 90.0.0.2 0.0.0.0 area 0 network 100.0.0.2 0.0.0.0 area 0 network 3.3.3.3 0.0.0.0 area 0 channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active
At PE2:
ip address 2.2.2.2 255.255.255.255 ip address 100.0.0.1 255.255.0.0 network 100.0.0.1 0.0.0.0 area 0 network 2.2.2.2 0.0.0.0 area 0 channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active
-
Configure the service instance from 2 to 129
switchport trunk allowed vlan none service instance 2 ethernet rewrite ingress tag pop 1 symmetric xconnect 1.1.1.1 2 encapsulation mpls service instance 129 ethernet rewrite ingress tag pop 1 symmetric xconnect 1.1.1.1 129 encapsulation mpls
This configuration enables load balancing in g0/4, g0/5, g0/11, g0/15 in P2 and PE2.
Layer 3 VPN Configuration Example
This example depicts configuration for 129 VPN Routing and Forwarding (VRF) instances. See Figure 1 for this configuration:
At PE1:
ip address 1.1.1.1 255.255.255.255
-
Configure EFP from 2 to 129
switchport trunk allowed vlan none service instance 2 ethernet rewrite ingress tag pop 1 symmetric service instance 129 ethernet rewrite ingress tag pop 1 symmetric
-
Configure VRF from 2 to 129
route-target export 129:129 route-target import 129:129
-
Add address-family from 2 to 129
no bgp default ipv4-unicast neighbor 2.2.2.2 remote-as 10 neighbor 2.2.2.2 update-source Loopback0 neighbor 2.2.2.2 activate neighbor 2.2.2.2 s-community both address-family ipv4 vrf vrf2 address-family ipv4 vrf vrf3 address-family ipv4 vrf vrf129
-
Configure VLAN from 2 to 129
ip address 172.16.0.1 255.255.255.240 ip address 172.16.0.17 255.255.255.240 ip address 172.16.7.241 255.255.255.240
At P1:
ip address 4.4.4.4 255.255.255.255 ip address 90.0.0.1 255.255.0.0 channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active
At P2:
ip address 3.3.3.3 255.255.255.255 ip address 90.0.0.2 255.255.0.0 ip address 100.0.0.2 255.255.0.0 channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active
At PE2:
ip address 2.2.2.2 255.255.255.255
-
Configure EFP from 2 to 129
switchport trunk allowed vlan none service instance 2 ethernet rewrite ingress tag pop 1 symmetric service instance 129 ethernet rewrite ingress tag pop 1 symmetric
-
Configure VRF from 2 to 129
route-target export 129:129 route-target import 129:129
-
Configure vlan from 2 to 129
ip address 172.26.0.1 255.255.255.240 ip address 172.26.0.17 255.255.255.240 ip address 172.26.7.241 255.255.255.240
-
Add address family 2 to 129
no bgp default ipv4-unicast neighbor 1.1.1.1 remote-as 10 neighbor 1.1.1.1 update-source Loopback0 neighbor 1.1.1.1 activate neighbor 1.1.1.1 s-community both address-family ipv4 vrf vrf2 address-family ipv4 vrf vrf3 address-family ipv4 vrf vrf129 ip address 100.0.0.1 255.255.0.0 channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active
This configuration enables load balancing on g0/4, g0/5, g0/11, g0/15 in P2 and PE2.
Load Balancing Over Port Channel: Configuration Example
To configure load balancing over port channel, use the following command:
port-channel load-balance
[
dst-ip
destination-ip-address
|
dst-mac
destination-mac-address |
src-dst-ip
source-XOR-destination-ip-address |
src-dst-mac
source-XOR-destination-mac-address |
src-ip
source-ip-address
|
src-mac
source-mac-address
]
Table 1 Syntax Description of the port-channel load balance command
|
|
dst-ip
destination-ip-address
|
Loads distribution on the destination IP address. Option to exclude VLAN in the distribution is provided using the
excludevlan
keyword along with this method.
|
dst-mac
destination-mac-address
|
Loads distribution on the destination MAC address.
|
src-dst-ip
source-XOR-destination-ip-address
|
Loads distribution on the source transfer or XOR-destination IP address. Option to exclude VLAN in the distribution is provided using the
excludevlan
keyword along with this method.
|
src-dst-mac
source-XOR-destination-mac-address
|
Loads distribution on the source XOR-destination MAC address.
|
src-ip
source-ip-address
|
Loads distribution on the source IP address. Option to exclude VLAN in the distribution is provided using the
excludevlan
keyword along with this method.
|
src-mac
source-mac-address
|
Loads distribution on the source MAC address.
|
Note Refer to Figure 1 for this configuration.
At PE1:
ip address 1.1.1.1 255.255.255.255 mpls ldp advertise-labels ip address 5.5.5.1 255.255.0.0 mpls ldp advertise-labels network 5.5.5.1 0.0.0.0 area 0 network 1.1.1.1 0.0.0.0 area 0
-
Configure the service instance from 2 to 129
switchport trunk allowed vlan none service instance 2 ethernet rewrite ingress tag pop 1 symmetric xconnect 2.2.2.2 2 encapsulation mpls service instance 129 ethernet rewrite ingress tag pop 1 symmetric xconnect 2.2.2.2 129 encapsulation mpls
At P1:
ip address 4.4.4.4 255.255.255.255 mpls ldp advertise-labels ip address 5.5.5.2 255.255.0.0 mpls ldp advertise-labels ip address 90.0.0.1 255.255.0.0 network 4.4.4.4 0.0.0.0 area 0 network 90.0.0.1 0.0.0.0 area 0 network 5.5.5.2 0.0.0.0 area 0 channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active
At P2
ip address 3.3.3.3 255.255.255.255 ip address 90.0.0.2 255.255.0.0 ip address 100.0.0.2 255.255.0.0 network 90.0.0.2 0.0.0.0 area 0 network 100.0.0.2 0.0.0.0 area 0 network 3.3.3.3 0.0.0.0 area 0 channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active channel-group 1 mode active channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active
At PE2:
ip address 2.2.2.2 255.255.255.255 ip address 100.0.0.1 255.255.0.0 network 100.0.0.1 0.0.0.0 area 0 network 2.2.2.2 0.0.0.0 area 0 channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active channel-group 2 mode active
-
Configure the service instance from 2 to 129
switchport trunk allowed vlan none service instance 2 ethernet rewrite ingress tag pop 1 symmetric xconnect 1.1.1.1 2 encapsulation mpls service instance 129 ethernet rewrite ingress tag pop 1 symmetric xconnect 1.1.1.1 129 encapsulation mpls
Load balancing should be enabled at g0/4, g0/5, g0/11, an dg0/15 in P2 and PE2.
Verifying the MPLS Load Balancing Configuration
The output of the following commands provides details of the MPLS load balancing configuration:
Switch# show l2vpn bridge-domain detail PW: neighbor 3.3.3.3, PW ID 200, state is up ( established ) PW class not set, XC ID 0xc0000001 Encapsulation MPLS, protocol LDP PW type Ethernet, control word disabled, interworking none ------------ ------------------------------ ------------------------- Control word disabled disabled PW type Ethernet Ethernet ------------ ------------------------------ -------------------------
-
Enabling load balance hashing:
Switch# show l2vpn xconnect detail PW: neighbor 3.3.3.3, PW ID 300, state is down ( provisioned ) PW class not set, XC ID 0x40008 Encapsulation MPLS, protocol LDP PW type Ethernet, control word disabled, interworking none ------------ ------------------------------ ----------------------------- Interface GigabitEthernet0/0/0/6 unknown Control word disabled unknown ------------ ------------------------------ -----------------------------
-
The following are sample outputs for the MPLS load balancing:
Switch# show ip route 10.255.17.42 Routing entry for 10.255.17.42/32 Known via "ospf 1", distance 110, metric 101, type intra area Last update from 192.168.207.170 on GigabitEthernet0/11, 1w3d ago Routing Descriptor Blocks: 192.168.207.182, from 10.255.17.42, 1w3d ago, via GigabitEthernet0/14 Route metric is 101, traffic share count is 1 192.168.207.178, from 10.255.17.42, 1w3d ago, via GigabitEthernet0/13 Route metric is 101, traffic share count is 1 * 192.168.207.174, from 10.255.17.42, 1w3d ago, via GigabitEthernet0/12 Route metric is 101, traffic share count is 1 192.168.207.170, from 10.255.17.42, 1w3d ago, via GigabitEthernet0/11 Route metric is 101, traffic share count is 1 Switch# show ip cef 10.255.17.42 nexthop 192.168.207.170 GigabitEthernet0/11 nexthop 192.168.207.174 GigabitEthernet0/12 nexthop 192.168.207.178 GigabitEthernet0/13 nexthop 192.168.207.182 GigabitEthernet0/14 Switch# show ip cef 10.255.17.42 internal 10.255.17.42/32, epoch 0, RIB[I], refcount 5, per-destination sharing LFD: 10.255.17.42/32 1 local label local label info: global/243 contains path extension list disposition chain 0x08E9B0B4 label switch chain 0x08E9B2D8 GigabitEthernet0/11(64): 192.168.207.170 GigabitEthernet0/12(65): 192.168.207.174 GigabitEthernet0/13(66): 192.168.207.178 GigabitEthernet0/14(67): 192.168.207.182 path 08EB8068, path list 08EAF274, share 1/1, type attached nexthop, for IPv4 MPLS short path extensions: MOI flags = 0x0 label implicit-null nexthop 192.168.207.170 GigabitEthernet0/11, adjacency IP adj out of GigabitEthernet0/11, addr 192.168.207.170 0950B0E0 path 08EB80DC, path list 08EAF274, share 1/1, type attached nexthop, for IPv4 MPLS short path extensions: MOI flags = 0x0 label implicit-null nexthop 192.168.207.174 GigabitEthernet0/12, adjacency IP adj out of GigabitEthernet0/12, addr 192.168.207.174 0950B540 path 08EB9EC4, path list 08EAF274, share 1/1, type attached nexthop, for IPv4 MPLS short path extensions: MOI flags = 0x0 label implicit-null nexthop 192.168.207.178 GigabitEthernet0/13, adjacency IP adj out of GigabitEthernet0/13, addr 192.168.207.178 0950AC80 path 08EB912C, path list 08EAF274, share 0/1, type attached nexthop, for IPv4 MPLS short path extensions: MOI flags = 0x0 label implicit-null nexthop 192.168.207.182 GigabitEthernet0/14, adjacency IP adj out of GigabitEthernet0/14, addr 192.168.207.182 0950A3C0 loadinfo 08E9AE90, per-session, 4 choices, flags 0003, 5 locks flags: Per-session, for-rx-IPv4 < 0 > IP adj out of GigabitEthernet0/11, addr 192.168.207.170 0950B0E0 < 1 > IP adj out of GigabitEthernet0/12, addr 192.168.207.174 0950B540 < 2 > IP adj out of GigabitEthernet0/13, addr 192.168.207.178 0950AC80 < 3 > IP adj out of GigabitEthernet0/14, addr 192.168.207.182 0950A3C0 < 4 > IP adj out of GigabitEthernet0/11, addr 192.168.207.170 0950B0E0 < 5 > IP adj out of GigabitEthernet0/12, addr 192.168.207.174 0950B540 < 6 > IP adj out of GigabitEthernet0/13, addr 192.168.207.178 0950AC80 < 7 > IP adj out of GigabitEthernet0/14, addr 192.168.207.182 0950A3C0 < 8 > IP adj out of GigabitEthernet0/11, addr 192.168.207.170 0950B0E0 < 9 > IP adj out of GigabitEthernet0/12, addr 192.168.207.174 0950B540 <10 > IP adj out of GigabitEthernet0/13, addr 192.168.207.178 0950AC80 <11 > IP adj out of GigabitEthernet0/14, addr 192.168.207.182 0950A3C0 <12 > IP adj out of GigabitEthernet0/11, addr 192.168.207.170 0950B0E0 <13 > IP adj out of GigabitEthernet0/12, addr 192.168.207.174 0950B540 <14 > IP adj out of GigabitEthernet0/13, addr 192.168.207.178 0950AC80 <15 > IP adj out of GigabitEthernet0/14, addr 192.168.207.182 0950A3C0 Switch# show mpls forwarding-table 10.255.17.42 Local Outgoing Prefix Bytes Label Outgoing Next Hop Label Label or VC or Tunnel Id Switched interface 243 Pop Label 10.255.17.42/32 252677583293010 Gi0/11 192.168.207.170 Pop Label 10.255.17.42/32 0 Gi0/12 192.168.207.174 Pop Label 10.255.17.42/32 0 Gi0/13 192.168.207.178 Pop Label 10.255.17.42/32 0 Gi0/14 192.168.207.182
Note The show mpls forwarding-table counters command does not display the switched packets for all interfaces. To view switched packets on each interface, use the show interface interface-name counter command.
Switch# show mpls ldp neighbor Peer LDP Ident: 10.255.17.42:0; Local LDP Ident 10.255.17.32:0 TCP connection: 10.255.17.42.18853 - 10.255.17.32.646 State: Oper; Msgs sent/rcvd: 186413/186396; Downstream GigabitEthernet0/12, Src IP addr: 192.168.207.174 GigabitEthernet0/11, Src IP addr: 192.168.207.170 GigabitEthernet0/13, Src IP addr: 192.168.207.178 GigabitEthernet0/14, Src IP addr: 192.168.207.182 Addresses bound to peer LDP Ident: 10.255.17.42 192.168.207.174 192.168.207.170 192.168.207.178 Peer LDP Ident: 10.255.10.3:0; Local LDP Ident 10.255.17.32:0 TCP connection: 10.255.10.3.646 - 10.255.17.32.11542 State: Oper; Msgs sent/rcvd: 18328/18297; Downstream Targeted Hello 10.255.17.32 -> 10.255.10.3, active, passive Addresses bound to peer LDP Ident: 10.255.10.3 172.31.10.3 192.168.190.61 192.168.190.57 10.11.11.1 10.255.4.1 192.168.190.65 192.168.190.70 Peer LDP Ident: 10.255.10.97:0; Local LDP Ident 10.255.17.32:0 TCP connection: 10.255.10.97.646 - 10.255.17.32.16411 State: Oper; Msgs sent/rcvd: 18318/18329; Downstream GigabitEthernet0/22, Src IP addr: 192.168.207.130 Addresses bound to peer LDP Ident: 10.255.10.97 172.31.10.97 192.168.191.149 192.168.191.193 192.168.191.205 192.168.191.157 192.168.191.209 192.168.191.201 192.168.191.213 192.168.191.217 192.168.191.229 192.168.191.225 192.168.191.233 192.168.191.221 192.168.191.161 192.168.191.134 192.168.191.138 192.168.207.130 192.168.191.130
Feature Information for MPLS Load Balancing
Use Cisco Feature Navigator to find information about platform support and software image support. Cisco Feature Navigator enables you to determine which software images support a specific software release, feature set, or platform. To access Cisco Feature Navigator, go to
http://www.cisco.com/go/cfn
. An account on Cisco.com is not required.
Note Table 2 lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Table 2 Feature Information for MPLS Load Balancing
|
|
|
MPLS Load Balancing
|
15.3(3)S
|
This feature was introduced.
|
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL:
www.cisco.com/go/trademarks
. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1721R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.
© 2013 Cisco Systems, Inc. All rights reserved.