Overview & Thematic Scope
This FAQ addresses common technical and operational questions about configuring BGP AS Path Prepending for outbound traffic engineering. It provides definitive answers for network engineers, covering fundamental concepts, configuration steps, risk mitigation, and troubleshooting. The guidance synthesizes best current practices from operational experience and IETF recommendations to ensure safe and effective deployment.

Frequently Asked Questions
- Q1: What is BGP AS Path Prepending and how does it influence outbound traffic?
- BGP AS Path Prepending is a traffic engineering technique used to deprioritize a specific route by making its AS_PATH attribute appear artificially longer. This is achieved by prepending the local Autonomous System Number (ASN) multiple times to the AS_PATH when advertising routes to a peer. Because BGP’s route selection process generally prefers the path with the shortest AS_PATH length, a route with multiple prepended ASNs becomes less preferred. This effectively allows a network operator to influence inbound traffic flow, steering it away from a less desirable link and towards a primary or preferred link in a multi-homed scenario.
- Q2: What is the typical configuration process for AS Path Prepending on network devices?
- The configuration typically involves creating a route-map or policy that sets the AS_PATH attribute and applying it to outbound BGP neighbor sessions, as shown in enterprise-grade guides. The exact steps vary by vendor, but the standard logic is as follows: (1) Create a route-map that specifies the number of times to prepend the local ASN (e.g., `set as-path prepend 65301 65301 65301` on Fortinet devices or configuring a `num_as_path_prepend` value on load balancers). (2) Apply this route-map to the outbound direction of the BGP neighbor or peer group for the link you wish to deprioritize. (3) Verify the configuration by checking the BGP routing table on the upstream router to confirm that the advertised route now has a longer AS_PATH. A practical example can be seen in SD-WAN platforms where activating AS Path Prepending with a value of ‘2’ adds two additional AS hops to the path, influencing upstream routing decisions.
- Q3: How does AS Path Prepending differ from Local Preference for traffic engineering?
- AS Path Prepending influences traffic engineering by affecting the route selection of *external* (upstream) networks, while Local Preference is an attribute used to influence route selection *within* your own Autonomous System. Local Preference is a non-transitive BGP attribute; it is not propagated to external peers and therefore cannot influence how your upstream ISPs or transit providers route traffic back to you. AS Path Prepending, being a transitive attribute, is passed to external peers, allowing you to signal to remote ASes that a particular path is less desirable. Therefore, to control outbound (egress) traffic from your network, you would typically use Local Preference or Weight. To influence inbound (ingress) traffic from your providers, you would use AS Path Prepending on the routes you advertise to them.
- Q4: What are the major risks associated with excessive or improper AS Path Prepending?
- Excessive AS Path Prepending carries significant risks, including vulnerability to route leaks and hijacks, and unintended global routing effects. The IETF warns that over-preprending can render routes highly susceptible to being hijacked, as a malicious actor could craft a shorter, plausible AS path that would be preferred globally. Furthermore, using a ‘prepend-to-all’ strategy (applying prepending to all transit providers) neutralizes any traffic engineering benefit and merely increases the risk of route manipulation during routing leaks. There are also cascading effects where multiple ASes prepending can cause routing policies to interact unpredictably, leading to unintended failovers. Industry analysis suggests that approximately 8% of the global IPv4 routing table may be at risk due to excessive prepending.
- Q5: What is the current industry best practice or standard for using AS Path Prepending?
- The current best practice, as defined in the IETF’s Best Current Practice (BCP) guidance, is to use AS Path Prepending sparingly, specifically, and only to achieve a clear traffic engineering objective, not as a general-purpose tool. Key recommendations include: only prepend to a subset of your providers to shape traffic patterns, avoid prepending to all providers (prepend-to-all), and consider using alternative, more granular methods like BGP Large Communities for selective path manipulation. Operators should carefully plan the number of prepends and validate the impact to avoid creating unintended path preferences that could compromise network stability or security.
- Q6: How do I troubleshoot if AS Path Prepending doesn’t seem to be working?
- Troubleshooting starts by verifying the BGP table on the upstream router to ensure the advertised route has the expected prepended AS_PATH, then systematically checking each configuration element. Common issues include: (1) The route-map is applied to the wrong direction (inbound vs. outbound) on the BGP neighbor; it must be applied outbound for path prepending to affect advertisements. (2) The route-map isn’t matched correctly by a ‘match’ condition. (3) There is a typo in the AS number or the configured number of prepends. (4) The BGP session hasn’t been reset (using ‘clear ip bgp * soft out’ or a similar command) to propagate the new policy. Additionally, ensure that the upstream router hasn’t filtered the route or that a preferred path from another source is still chosen. Verifying the configuration and checking for route propagation are the first critical steps.
- Q7: Are there modern alternatives to AS Path Prepending for outbound traffic engineering?
- Yes, modern approaches include machine learning-driven traffic engineering, SDN-based centralized control, and BGP Large Communities for more granular policy signaling. Research has demonstrated that machine learning-driven approaches (MLOTE) can significantly outperform traditional BGP traffic engineering by proactively predicting traffic demands and dynamically selecting optimal paths, reducing latency and peak interface utilization. SDN architectures offer a reactive, centralized control plane for traffic management. In many modern networks, BGP Large Communities are also recommended as a more nuanced and secure way for ISPs to signal traffic engineering intent to peers without relying solely on AS path length, helping to mitigate the risks associated with excessive prepending.
Leave a comment