اس سبق کے بعد آپ BGP کا مکمل best-path الگورتھم سمجھ جائیں گے، پاتھ attributes ٹیون کرنا سیکھیں گے اور BGP convergence تیز کرنے کے طریقے جان جائیں گے۔
Is lesson ke baad aap BGP ka mukammal best-path algorithm samajh jayenge, path attributes tune karna seekhenge aur BGP convergence tez karne ke tareeqay jaan jayenge.
After this lesson you will understand the full BGP best-path algorithm, tune path attributes, and know how to speed up BGP convergence.
BGP ایسا ہے جیسے ہوائی جہاز کا روٹ چننا — سب سے پہلے براہ راست فلائٹ (weight/local-pref)، پھر سب سے چھوٹی فاصلہ، پھر سستی ایئر لائن۔ ہر مرحلہ ایک tie-breaker ہے۔
BGP aisa hai jaise hawai jahaz ka route chunna — sab se pehle direct flight (weight/local-pref), phir sab se chhota fasla, phir sasti airline. Har marhala ek tie-breaker hai.
BGP is like picking a flight — first the direct flight (weight/local-pref), then shortest distance, then cheapest airline. Each step is a tie-breaker.

چار روٹرز لیں: R1 اور R2 ایک AS میں (iBGP)، R3 اور R4 دوسرے AS میں (eBGP)۔ ہر AS کے اندر loopback نیٹ ورکس بنائیں تاکہ best-path فیصلے دیکھ سکیں۔
Chaar routers lein: R1 aur R2 ek AS mein (iBGP), R3 aur R4 doosre AS mein (eBGP). Har AS ke andar loopback networks banayein taake best-path decisions dekh sakein.
Use four routers: R1 and R2 in one AS (iBGP), R3 and R4 in another AS (eBGP). Create loopback networks in each AS to observe best-path decisions.
بنیادی BGP peers بنائیں۔ eBGP کے لیے directly connected نیبرز اور iBGP کے لیے loopback پر مبنی peers استعمال کریں۔
Bunyadi BGP peers banayein. eBGP ke liye directly connected neighbors aur iBGP ke liye loopback par based peers use karein.
Build basic BGP peers. Use directly connected neighbors for eBGP and loopback-based peers for iBGP.
router bgp 65001neighbor 10.0.0.2 remote-as 65002network 192.168.1.0 mask 255.255.255.0Best-path ترتیب: Weight (سب سے زیادہ) → Local Preference → Locally originated → AS-path (سب سے چھوٹا) → Origin → MED → eBGP over iBGP → IGP metric → Router-ID۔
Best-path order: Weight (sab se zyada) → Local Preference → Locally originated → AS-path (sab se chhota) → Origin → MED → eBGP over iBGP → IGP metric → Router-ID.
Best-path order: Weight (highest) → Local Preference → Locally originated → AS-path (shortest) → Origin → MED → eBGP over iBGP → IGP metric → Router-ID.
show ip bgp 192.168.1.0Weight صرف لوکل روٹر پر اثر ڈالتا ہے، جبکہ Local Preference پورے AS میں پھیلتا ہے۔ outbound ٹریفک کنٹرول کے لیے local-pref استعمال کریں۔
Weight sirf local router par asar dalta hai, jabke Local Preference puray AS mein phailta hai. Outbound traffic control ke liye local-pref use karein.
Weight affects only the local router; Local Preference propagates across the AS. Use local-pref to control outbound traffic.
route-map SET-PREF permit 10set local-preference 200neighbor 10.0.0.2 route-map SET-PREF inAS-path prepending سے inbound ٹریفک متاثر کریں — اپنا AS نمبر بار بار جوڑنے سے راستہ لمبا لگتا ہے اور دوسرے اسے کم ترجیح دیتے ہیں۔
AS-path prepending se inbound traffic affect karein — apna AS number baar baar jorne se rasta lamba lagta hai aur doosre use kam tarjeeh dete hain.
Use AS-path prepending to influence inbound traffic — repeating your AS number makes the path look longer so others prefer alternatives.
route-map PREPEND permit 10set as-path prepend 65001 65001neighbor 10.0.0.2 route-map PREPEND outBGP timers ڈیفالٹ 60/180 سیکنڈ ہوتے ہیں۔ کنورجنس تیز کرنے کے لیے انہیں کم کریں، اور BFD شامل کریں تاکہ لنک فیل فوری پکڑا جائے۔
BGP timers default 60/180 seconds hote hain. Convergence tez karne ke liye inhen kam karein, aur BFD shamil karein taake link fail fori pakra jaye.
BGP timers default to 60/180 seconds. Lower them for faster convergence, and add BFD so link failures are detected instantly.
neighbor 10.0.0.2 timers 10 30neighbor 10.0.0.2 fall-over bfdAdvertisement interval ڈیفالٹ eBGP کے لیے 30 سیکنڈ ہے — اسے 0 پر سیٹ کریں تاکہ اپڈیٹس فوری بھیجی جائیں۔ iBGP پر یہ پہلے سے 0 ہوتا ہے۔
Advertisement interval default eBGP ke liye 30 seconds hai — use 0 par set karein taake updates fori bheji jayen. iBGP par ye pehle se 0 hota hai.
The advertisement interval defaults to 30s for eBGP — set it to 0 so updates go out immediately. It's already 0 for iBGP.
neighbor 10.0.0.2 advertisement-interval 0ایک لنک بند کر کے failover وقت ناپیں۔ بہترین راستہ بدلنے پر 'show ip bgp' میں next-hop اور path attributes کی تبدیلی دیکھیں۔
Ek link band kar ke failover waqt napein. Behtareen rasta badalne par 'show ip bgp' mein next-hop aur path attributes ki tabdeeli dekhen.
Shut a link and measure failover time. When the best path changes, observe the next-hop and path attribute changes in show ip bgp.
shutdownshow ip bgp summaryno shutdownیقین کریں کہ ہر prefix کے لیے best path نشان زد ہے (> کا نشان)، ٹائمرز نئے values پر ہیں، اور BFD sessions up ہیں۔
Yaqeen karein ke har prefix ke liye best path marked hai (> ka nishan), timers naye values par hain, aur BFD sessions up hain.
Confirm every prefix has a marked best path (the > symbol), timers show new values, and BFD sessions are up.
show ip bgpshow ip bgp summaryshow bfd neighbors