Octet

How do you influence outbound traffic versus inbound traffic with BGP?

Show the answer

Say this first

Outbound traffic is under my control: I decide which path to install, with local preference across the AS or weight on one router, and by filtering what I accept. Inbound traffic depends on other ASes' decisions, so I can only change what I advertise to influence them: AS path prepending, MED toward one provider, the provider's communities that set its local preference, or more specific prefixes on the preferred link. Inbound is never guaranteed, because every other AS applies its own policy first.

Go deeper

Tools by direction

DirectionToolStrength
OutboundLOCAL_PREF inbound on the preferred ISPFirm, AS-wide
OutboundWeightFirm, one router
OutboundAccept only a default from the backup ISPFirm, simple
InboundMore specific prefixes on the preferred linkStrongest: longest match wins everywhere
InboundProvider community that lowers its local preferenceStrong inside that provider
InboundAS path prepending on the backup linkModerate; loses to anyone's local preference
InboundMEDWeak; only between links to the same provider

Example: prefer ISP1 in both directions

Cisco IOS
route-map ISP1-IN permit 10
 set local-preference 200
!
route-map ISP2-OUT permit 10
 match ip address prefix-list OUR-PREFIXES
 set as-path prepend 64500 64500 64500

Why prepending alone often disappoints

ISP2 and its customers usually prefer routes learned from customers (you) with a higher local preference than routes from peers. Your prepends are never looked at by them, so traffic from ISP2's own network still arrives over the backup link. The fix is ISP2's documented backup community.

Traps

  • Using local preference to try to steer inbound traffic.
  • Promising an interviewer an exact inbound split. You can influence it, not guarantee it.
How did you do?Book 4.1 Global Internet