O'Reilly logo

JUNOS Cookbook by Aviva Garrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13.14. Load-Balancing BGP Traffic

Problem

A customer is multihomed to two different routers in your point of presence (POP). Instead of having BGP send all traffic across one of the links, which is the default behavior, you want to load-balance the EBGP traffic from the customer across the two links.

Solution

To enable load balancing across multiple EBGP peerings, configure the BGP group to use multipath:

	[edit protocols bgp group external-group]
	aviva@Router1# set type external
	aviva@Router1# set peer-as 65505
	aviva@Router1# set multipath
	aviva@Router1# set neighbor 192.168.1.1
	aviva@Router1# set neighbor 192.168.1.3

For the load balancing to happen, configure a load-balancing policy:

	[edit policy-options]
	aviva@router1# set policy-statement LoadBalance from route-filter 192.168.1.0/24
	orlonger
	aviva@Router1# set policy-statement LoadBalance then load-balance per-packet

	[edit routing-options]
	aviva@Router1# set forwarding-table export LoadBalance

Discussion

Multihomed connections from a customer's network to the ISP's POP provide redundant Internet connectivity. If one of the links goes down—for example, because a fiber was cut—the second connection provides backup. If the paths from both connections are equal-cost, the default BGP behavior is to select the single best route to a destination. The result is that BGP uses only one of the links to forward traffic. As long as both links are up, the customer wants to use both, spreading the traffic between them to increase the bandwidth ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required