Outbound/Inbound load balance with BGP

Posted on 2003-03-04
Medium Priority
Last Modified: 2009-12-16
I have a Cisco router with two links to the same provider.
We're running BGP, but we only get a default route from them.

We dont have our own IP block or AS.

We'd like to load balance our incoming and outcoming
traffic and, in case one of the links goes down,
the other one assumes. How can we do that?


Question by:enyamada
  • 3
  • 2
  • 2
  • +1
LVL 79

Expert Comment

ID: 8066198
Simply use two default routes with same cost:

ip route <serial ip upstream 1>
ip route <serial ip upstream 2>

This automaticaly creates packet-by-packet load balancing and automatic failover. If one link goes down, the other one automatically takes all the traffic.

The ISP router upstream must also do the same thing for inbound load-balancing.

If you're running bgp you should have loadbalancing and failover already. Why do you feel like you don't?


Expert Comment

ID: 8066541
all things being equal (cost, localpref, etc...), bgp will do path selection based on the lowest routerid(ip address).

Bookmark this one :)
BGP Best Path Selection Algorithm

You can enable load balancing by using the 'maximum-paths' command. (maximum-paths 2 in this case).

Another way to try and accomplish this is by peering with loopback interfaces rather than the serial interfaces and using the ebgp-multihop command. This way you get around the (all things being equal, choose the path with the lowest routerid problem). This will take some cooperation on the part of your ISP though, as they may not want to do this, or don't do it as a general rule. However, there's nothing that says that you can't assign a loopback address on your router and have the isp peer with that.

more bgp configuration info:

As far as packet-by-packet load sharing...i'm not really a big fan. It's generated too much cpu load from my experience (in *my* environment at least) and generally just deal with flows being balanced.

This way you have a fair measure of load balancing and redundancy.

lrmoore brings something up too...if all you're receiving is default, you're not multi-homed (to different ISP's) and don't have your own AS, why run bgp? Is it a requirement of your isp?

Just curious about ways to simplify your life :)

Author Comment

ID: 8071126
To Lrmoore:

It seems there's a problem with your solution; I've heard
that, depending on the ISP network layer 2 topology,
it's possible a situation where the link is down
but the interface is still up -- in this case,
as static routes dont use any kind of hello protocol,
the router simply sends packets to a fallen link.

BGP is not currently balancing probably because
we're not using the maximum-paths command.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 8071136

If we simply add the maximum-path command,
the incoming trafiic will be load balanced as well?

Why we're using BGP? I'm not sure really... I've just
joined the company a week ago and BGP was already
in place. Probably because the ISP recommended.

LVL 79

Accepted Solution

lrmoore earned 200 total points
ID: 8071239
>depending on the ISP network layer 2 topology,
it's possible a situation where the link is down
but the interface is still up
Never seen it happen if the interface is configured correctly. i.e. frame-relay interface (very typical) not configured on a sub-if and interface dlci

CEF is another option with two equal cost routes.
ip cef
this changes the packet-by-packet load balancing to per-connection


Expert Comment

ID: 8073060
the maximum-paths statement would need to be on the isp's side balance outbound traffic(from the isp's perspective), towards you. maximum-paths on your router will balance your outbound traffic.

I also mentioned the loopback peering because it isn't clear that both of your circuits terminate on the same router at the ISP. Depending on their topology, maximum-paths may still not balance how you like on your inbound traffic due to the ISP's igp will prefer the closest exit point.

The static routes that you're concerned about are called 'floating' statics, that is to say, they actually point to your local serial interface like this:

ip route serial0/0

This way, if the serial link goes down, the router recognizes it's state and withdraws the route from the FIB.

When you do this though, I tend to put the interface command down-when-looped so that if you're ever doing testing you don't blackhole half your traffic(this isn't a critical issue, just one of those nice-to-haves).

Expert Comment

ID: 8198893
What Lrmoore stated works best for load balancing.
ip cef
IP load-sharing per-packet on each serial interface on both routers, provided they are booth Ciscos and bother terminate on the same router, not necessarily the same slot/card/DS3, but on the same chassis run off a single processor like a 7200/7500/10000 series router.
LVL 79

Expert Comment

ID: 8725631
No comment has been added lately (82 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to lrmoore

Please leave any comments here within 7 days.



EE Cleanup Volunteer
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers,
please post comments here where a Moderator will see it.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Description:   Couple of months ago we upgraded the ADSL line at our branch office from Home to Business line. The purpose of transforming the service to have static public IP’s. We were in need for public IP’s to publish our web resour…
I recently attended Cisco Live! in Las Vegas, a conference that boasted over 28,000 techies in attendance, and a week of hands-on learning hosted by a solid partner with which Concerto goes to market.  Every year, Cisco displays cutting-edge technol…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question