Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Configuring Load Balancing Using Source or Destination IP Only

In equal-cost multipath, (ECMP) per-subscriber aware environments such as content service providers who service residential customers, traffic in both directions within the service provider network should always pass through the content servers that maintain the subscriber state information for a given subscriber. This is accomplished by calculating the load balancing hash based solely on source address for traffic coming into the service provider network and calculating the load balancing hash based solely on the destination address for traffic leaving the service provider network.

Source and destination only load balancing is generally configured in an ECMP or aggregated ethernet (AE) environment on an service provider network. It is usually applied to all of the PE routers. It is only supported for IPv4 (inet) and IPv6 (inet6) traffic.

You do not need any special configuration in place before starting this configuration.


This feature will only work on IP-based traffic. In the case of L3VPN traffic, only MPLS lookup will be performed on the PE routers when the default label assignment scheme is used. In order to use source-or-destination only load-balancing with L3VPN, you can either configure vrf-table-label or add a vt- interface in the routing instance.

To configure load balancing using source or destination IP only, you first configure system-wide forwarding options with a prefix-length to use when calculating the hash-key. Then, you configure a policy action of either load-balance source-ip-only or load-balance destination-ip-only within a policy statement.

  1. To configure system-wide prefix length for use with source and destination IP only load balancing, insert the source-destination-only-load-balancing configuration statement at the [edit forwarding-options enhanced-hash-key] hierarchy level and add a prefix length:
  2. To configure routing policy to use load balancing based on source or destination IP only, insert either the source-ip-only or destination-ip-only as an action statement within a policy statement at the [edit policy-options policy-statement policy-name] hierarchy level:

The source-ip-only and destination-ip-only configuration elements cannot be used together in the same term. This is because of the directional nature of the traffic that we are load balancing. To use the two elements in the same policy statement, you create two separate terms, each using a route filter specification that addresses the same traffic. Then use source-ip-only for the inbound traffic and destination-ip-only for the outbound traffic.