AS Path Prepending is a BGP feature used to make a specific path appear less preferred by artificially lengthening the AS path. This is done by adding your AS number multiple times to the AS path. It is a common method to influence inbound traffic from external networks.
- Longer AS Path = Less preferred route.
Example Scenario:
You have two ISPs: ISP1 (through CE1) and ISP2 (through CE2). You want inbound traffic from the internet to prefer ISP1 over ISP2.
Network Topology:
- CE1 (connected to ISP1): 10.0.1.1/30
- CE2 (connected to ISP2): 10.0.2.1/30
- iBGP Router (Internal) connected to both CE1 (10.0.1.2/30) and CE2 (10.0.2.2/30).
Configuration on CE2 (AS Path Prepending to Make ISP2 Less Preferred):
Create a route map to prepend your AS path multiple times for CE2:
route-map PREPEND_AS permit 10 set as-path prepend 65001 65001 65001
Apply this route map to the neighbor in the BGP configuration for CE2:
router bgp 65001 neighbor 10.0.2.1 remote-as 65002 neighbor 10.0.2.1 route-map PREPEND_AS out
Configuration on CE1 (No AS Path Prepending):
No AS Path Prepending is needed for CE1:
router bgp 65001 neighbor 10.0.1.1 remote-as 65000
Result:
Inbound traffic will prefer ISP1 (CE1) because CE2 has a longer AS path due to AS Path Prepending.
Comments
Post a Comment