Hello, Please see the below diagram. We want R1 to be primary path in connection to ISP1 bgp. we setup higher local pref for inbound routes at R1. For outbound routes, shorter as-path would be at R1. Do you think if this is good choice? because we are not sure if there is connection between ISP1-R and ISP2-R. If not, the as-path would not work, right?
Hi @zshowip ,
If this is simulate a real life scenario, you need to bear in mind the way service providers operate.
Most service providers use the local preference to set the following preference for the routes they receive.
Customer routes preferred over Peering routes, Peering routes preferred over Transit routes.
Given that the in BGP best path selection, the evaluation of the local preference takes precedence over the AS path length, ISP2 would prefer the customer routes even if as path prepending has been used.
So in most cases prepending the local ASN is not a predictable way to force inbound traffic one way or the other. If you want to guarantee that inbound traffic will come through ISP1, you could use conditional advertisement, which consists of advertising your local routes to ISP2 only if ISP1 is down.
Hi @zshowip ,
From the service provider point of view, there are generally 3 categories of routes.
- The customer routes are the routes received directly from their customers. The traffic received and sent from the customer is paid by the customer.
- The peering routes are generally exchange between two service providers and traffic between them is generally free of charge, but can generate charges if a certain pre-established threshold is crossed by one of the peers.
- The transit routes are received from another service provider (tier 1) and traffic sent to and received from that service provider is paid.
Hopefully you can see why the service provider prefers customer routes (traffic charged to customer) over peering routers (generally free, but can generate charges to the service provider) over transit routes (will generate charges to the service provider).