Network labs Docs Open simulator →

BGP — AS-path prepending for egress path influence

Prepend AS 65001 to the AS_PATH of 192.168.1.0/24 advertised outbound to R2, making the path artificially longer so a future second R2-side neighbour (or R2's iBGP siblings) prefer the unprepended path.

Open this lab in your browser →

Free · no install · no account

Scenario

AS-path prepending is the classic egress-engineering tool: you can't reach into your neighbour's policy, but you can make your own advertisement *look* less attractive than another exit's by prepending your AS multiple times to the AS_PATH. Best-path selection (after weight, local-pref, origin) picks the shortest AS_PATH. Prepending grows the path. Where: `` Original: AS_PATH = [65001] (length 1) Prepended: AS_PATH = [65001 65001 65001] (length 3) ` In this lab R1 (AS 65001) advertises 192.168.1.0/24 to R2 (AS 65002). You'll add an outbound route-map that prepends 65001 twice. After commit, R2's BGP table should show AS_PATH 65001 65001 65001` for the prefix.

Topology

2 × router · Cisco IOS-style

What you will do

  1. On R1, define route-map PREPEND-R2 permit 10 with set as-path prepend 65001 65001.

  2. Bind the route-map outbound on R2: neighbor 10.0.12.2 route-map PREPEND-R2 out.

  3. Verify on R2: show ip bgp should show AS_PATH 65001 65001 65001 for 192.168.1.0/24.

Open this lab in your browser →

More labs on this topic

This lab in other languages

BGP — AS-Path-Prepending zur Beeinflussung des Egress-PfadsBGP — AS-path prepending para influir en la ruta de salidaBGP — AS-path prepending para influenciar o caminho de saídaBGP — AS-path prepending pour influencer le chemin de sortieBGP — egress path influence के लिए AS-path prependingBGP — 通过 AS-path prepend 影响出方向路径BGP — AS-path prepending per influenzare il percorso egressBGP — AS-path prepend によるエグレスパス影響BGP — egress 경로 영향용 AS-path prependingBGP — AS-path prepending для влияния на egress-путьBGP — egress yolunu etkilemek için AS-path prependingBGP — AS-path prepending để ảnh hưởng đường đi egress