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
| Direction | Tool | Strength |
|---|---|---|
| Outbound | LOCAL_PREF inbound on the preferred ISP | Firm, AS-wide |
| Outbound | Weight | Firm, one router |
| Outbound | Accept only a default from the backup ISP | Firm, simple |
| Inbound | More specific prefixes on the preferred link | Strongest: longest match wins everywhere |
| Inbound | Provider community that lowers its local preference | Strong inside that provider |
| Inbound | AS path prepending on the backup link | Moderate; loses to anyone's local preference |
| Inbound | MED | Weak; only between links to the same provider |
Example: prefer ISP1 in both directions
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 64500Why 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.
They will ask next
Why not always announce more specifics on the preferred link?
Most networks drop IPv4 prefixes longer than /24 and IPv6 longer than /48, so you may have nothing smaller to announce. More specifics also grow the global table and need ROAs that allow them. If you do it, announce the covering aggregate on both links so the backup still works.
How do you see how inbound traffic actually splits?
Interface counters or NetFlow per uplink, plus external views: looking glasses, RIPE RIS and similar collectors show which path other networks chose.
Traps
- Using local preference to try to steer inbound traffic.
- Promising an interviewer an exact inbound split. You can influence it, not guarantee it.