You optimize outbound traffic with local preference, weight, and AS path manipulation you control locally. You optimize inbound traffic indirectly with AS path prepending, MED, and communities signaled to upstreams. BGP multi-homing gives you redundancy, yet it does not deliver optimal paths on its own. You must engineer both directions deliberately. This guide shows how each attribute fits one direction, how to balance load and fail over cleanly, how to spot asymmetric routing, and how to verify results with real show commands and looking glasses.

BGP multi-homing fundamentals

Dual multi-homed design and path control

BGP multi-homing connects your network to more than one provider. You gain failover when a link drops, and you gain traffic engineering options when both links stay up. A dual multi-homed design takes this further. You peer with two providers, and BGP distributes traffic among them based on the policies you set. Reliability improves because no single provider outage takes you offline. Performance improves because you can steer each direction toward the better path.

Path control works differently in each direction. Outbound decisions happen on your routers, so you hold direct control. Inbound decisions happen on remote networks, so you influence them rather than command them. Keep this split in mind for every policy you write.

The BGP best-path algorithm

The algorithm evaluates attributes in a fixed order. Understanding this sequence tells you which knob to turn first.

  1. Highest weight wins. Weight is local to one router and never leaves it.
  2. Highest local preference wins. This value spreads across your autonomous system.
  3. Locally originated routes win over learned routes.
  4. Shortest AS path wins.
  5. Lowest origin type wins, with IGP preferred over EGP, and EGP over incomplete.
  6. Lowest MED wins, when paths arrive from the same neighboring AS.
  7. External paths beat internal paths.
  8. Lowest IGP metric to the next hop wins.

You face one design tradeoff early. Receiving full BGP tables from both providers gives your router the most information, so outbound routing becomes more optimal. Originating or receiving only a default route keeps memory and CPU low, yet you lose the detail needed for fine-grained selection. Match the choice to your router capacity and your need for precision.

Outbound path control in BGP multi-homing

Outbound traffic engineering controls how your network sends traffic to external destinations. Your local router makes every outbound decision, so you hold the steering wheel. Balancing outbound traffic still requires inbound routing information from your BGP peers. Without those advertisements, the router cannot compare paths and pick an informed one.

Local preference and weight

Local preference spreads across your whole autonomous system. Weight stays on one router and never leaves it. Use local preference when every router in your network should agree on an exit. Use weight when you want one router to prefer a peer without changing policy elsewhere.

The example below prefers ISP A for all outbound traffic. Local preference 200 beats the default of 100.

The show output confirms the choice. The path through ISP A carries the higher local preference, so the router installs it as best.

Weight works the same way at the router level. A weight of 500 on the ISP A neighbor wins before local preference is even checked.

AS path and prefix advertisement

You can also steer outbound traffic per prefix. Advertise one /24 block to ISP A and a second /24 block to ISP B. Each provider then returns a path for the block you sent it, and your router forwards that block’s traffic out the matching link. This technique splits outbound load without touching local preference.

Default route origination gives you a simpler lever. Inject a default route into your IGP from the router facing your preferred provider. Traffic without a more specific match then follows that default toward the chosen exit. Pair this with a floating static route or a second default with a higher metric for failover. The approach costs little memory and keeps selection predictable. It also gives up fine-grained optimization, so reserve it for networks where a single preferred exit is acceptable.

Inbound traffic optimization

Inbound traffic engineering focuses on how external traffic enters your network. You do not control these decisions directly. Remote networks run their own best-path algorithm, and they pick the exit based on what your advertisements tell them. AS path prepending is the common technique for influencing which path external networks select. You make one path look longer, so remote routers prefer the other one.

AS path prepending and MED

Prepending repeats your AS number in the advertisement sent to one provider. The receiving network sees a longer AS path and steers toward the shorter one. The example below adds your AS three times toward ISP B, so ISP A becomes the preferred entry point.

Prepending fits best when you want a blunt, widely respected signal. Every network on the internet honors AS path length, so the effect reaches far beyond your direct peers. Its limits matter too. Prepending affects all traffic toward that prefix, so you cannot split traffic by source. Neighboring networks may also apply their own local preference first, which overrides your prepend entirely.

MED offers a finer tool. It signals a preferred entry point to a single neighboring AS. Lower values win. Use MED when both links connect to the same provider and you want that provider to choose your better circuit. MED stops at the provider boundary in most designs, so it cannot influence networks further away. Prepending travels farther; MED gives you precision within one relationship.

Communities and prefix filtering

Communities carry policy signals to your upstreams. You tag a prefix with a community value, and the provider’s route map reads that tag and acts on it. A common pattern marks a prefix for backup-only treatment, so the provider lowers its local preference for that route. The provider defines the community values, so confirm them in your peering agreement before you rely on them.

Prefix filtering acts as a safeguard. Filter what you accept from each peer and what you announce to each peer. An accurate filter list prevents route leaks and keeps your announcements intentional. Treat the filter as the enforcement layer behind every policy you signal.

Multi-exit backbone designs need planning before you apply any of these tools. Map where most inbound traffic originates first. Traffic from one region may enter through a different provider than traffic from another. Apply prepending or MED per prefix based on that map. Blanket policies across a BGP multi-homing setup often push traffic toward a path that only serves one region well.

Load balancing and failover

BGP multipath and backup paths

By default, the decision process installs only one best route per prefix. BGP multipath changes that behavior. You enable it so the router considers paths from all peers during computation and installs several equal-cost routes into the forwarding table. Traffic then shares across providers instead of draining through a single exit. The paths must match on the attributes the algorithm compares before the tie-breaker, so identical AS path length and equal local preference usually come first. Check your platform’s support and its limit on installed paths before you plan a design around it.

Backup paths need a different treatment. You want a second exit ready to carry traffic the moment the primary fails, without competing for load during normal operation. Raise local preference on the preferred peer and leave the alternate at the default. The router keeps the backup in its table as a valid path and promotes it automatically when the primary withdraws. This design gives you fast convergence with predictable behavior.

Conditional advertisement

Conditional advertisement automates failover for inbound traffic. Your router watches a prefix in its BGP table and announces a secondary prefix only when that watched route disappears. Remote networks then learn your backup path at the moment it matters, and they never see it during normal operation.

The exist-map condition controls the trigger. When the primary link prefix vanishes from the table, the backup block goes out. Test this behavior before you depend on it, because a flapping primary link can cause the advertisement to toggle.

Asymmetric routing and verification

Detecting asymmetric routing

Asymmetric routing means traffic leaves through one provider and returns through another. Multi-homed networks produce this behavior easily. Your local preference choice picks the outbound exit, and a remote network’s best-path decision picks the inbound entry. Nothing coordinates the two, so the forward and return flows can diverge.

This divergence matters most when a stateful device sits in the flow. A firewall tracks connections and expects to see both directions of a session. When the return packet arrives on a different interface, the firewall may drop it as unsolicited. Stateless routers forward the same traffic without complaint, so the problem often hides until you add inspection.

You can mitigate the issue in several ways. Align your outbound policy with the inbound path your upstreams prefer, so both directions use the same provider. Place firewalls where both paths converge, or configure them to accept asymmetric flows. Document any intentional asymmetry, because the next engineer will treat it as a fault.

Verifying with show commands and looking glasses

Confirm outbound selection on your own routers first. Run show ip bgp for a specific prefix and read the local preference, weight, and AS path on the best entry. Follow with show ip route to confirm the router installed that path in the forwarding table. Check the other border router too, since weight stays local and the two devices may disagree.

Inbound selection needs outside evidence. A looking glass at a remote provider shows the path that network selects toward your prefix. Query several locations to see how far your prepending or MED reaches. Compare the results against your policy intent.

Work through a troubleshooting sequence in this order:

  1. Verify the prefix exists in your BGP table with the expected attributes.
  2. Confirm the route map matches and applies in the correct direction.
  3. Check the forwarding table for the installed path.
  4. Query a looking glass from the direction you care about.
  5. Compare observed behavior with your documented intent.

Control outbound traffic locally with local preference and weight. Influence inbound traffic indirectly with AS path prepending, MED, and communities. That directional rule keeps your BGP multi-homing design predictable and easy to explain.

Build for load balancing and failover from the start. Watch for asymmetric routing where stateful devices sit in the flow. Verify every change with show commands and a looking glass.

Document your policy intent per prefix. Revisit that document as upstream relationships change. A written record turns a working configuration into a maintainable one. The network then stays optimized long after the initial cutover.

FAQ

Which attribute should you tune first for outbound traffic?

Start with local preference. It spreads across your autonomous system, so every router agrees on the exit. Reach for weight only when one router needs a local exception. Both beat AS path length in the decision order, so a small change here moves traffic fast.

Does AS path prepending always shift inbound traffic?

No. Prepending makes one path look longer, and most networks honor that signal. A remote provider’s local preference still wins, though. That provider may ignore your prepend entirely. Check a looking glass before you assume the change worked.

Why can you influence inbound traffic but not control it?

Remote networks run their own best-path algorithm. They pick the entry point based on your advertisements and their own policy. You shape what they see through prepending, MED, and communities. The final decision stays on their routers, not yours.

When does asymmetric routing actually cause trouble?

It matters when a stateful device sits in the flow. A firewall expects both directions of a session and may drop the return packet. Stateless routers forward the same traffic without issue. Align your outbound policy with the preferred inbound path to reduce the risk.

Do you need full BGP tables from both providers?

Not always. Full tables give your router the detail for precise outbound selection. They also cost memory and CPU. A default route keeps things simple and predictable. Match the choice to your router capacity and your need for fine-grained control.