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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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.
Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.


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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Hello , This is a short article on how would you go about enabling traceoptions on a Juniper router . Traceoptions are similar to Cisco debug commands but these traceoptions are implemented in Juniper networks router . The following demonstr…
We've been using the Cisco/Linksys RV042 for years as: - an internet Gateway - a site-to-site VPN device - a leased line site-to-site subnet-to-subnet interface (And, here I'm assuming that any RV0xx behaves the same way as an RV042.  So that's …
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…
Suggested Courses

765 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