BGP Advanced: Route Reflectors, Filtering & Communities

CCNP ENARSI 300-410 EVE-NG / GNS3

مقصدObjectiveObjective

اس لیب میں آپ iBGP کے full-mesh مسئلے کا حل (Route Reflector)، prefix-list سے فلٹرنگ، اور BGP communities کا استعمال سیکھیں گے۔Is lab mein aap iBGP ke full-mesh masle ka hal (Route Reflector), prefix-list se filtering, aur BGP communities ka istemal seekhenge.In this lab you will learn the fix for iBGP's full-mesh problem (Route Reflector), filtering with prefix-lists, and the use of BGP communities.

آسان مثالSimple AnalogySimple Analogy

iBGP کا full-mesh ایسا ہے جیسے دفتر میں ہر ملازم ہر دوسرے ملازم کو الگ الگ ای میل بھیجے — شور اور الجھن۔ Route Reflector وہ مینیجر ہے جو خبر ایک بار لے کر سب کو پہنچا دیتا ہے۔ Communities راستوں پر لگے رنگین لیبل ہیں جن کی بنیاد پر دور دراز کے راؤٹرز فیصلے کرتے ہیں۔iBGP ka full-mesh aisa hai jaise daftar mein har mulazim har doosre mulazim ko alag alag email bheje — shor aur uljhan. Route Reflector woh manager hai jo khabar ek baar le kar sab ko pahuncha deta hai. Communities raston par lage rangeen label hain jin ki bunyad par door daraz ke routers faisle karte hain.iBGP full-mesh is like every office employee emailing every other employee separately — noise and confusion. A Route Reflector is the manager who takes the news once and delivers it to all. Communities are colored labels on routes that distant routers act upon.

سیٹ اپLab SetupLab Setup

ایک ہی AS 65001 میں چار راؤٹرز: R1 (RR)، R2 اور R3 (clients)، R4 (non-client)۔ R2 ایک eBGP راستہ 10.50.0.0/16 لاتا ہے۔ مقصد: بغیر full-mesh کے سب تک راستہ پہنچانا۔Ek hi AS 65001 mein chaar routers: R1 (RR), R2 aur R3 (clients), R4 (non-client). R2 ek eBGP rasta 10.50.0.0/16 lata hai. Maqsad: baghair full-mesh ke sab tak rasta pahunchana.Four routers in one AS 65001: R1 (RR), R2 and R3 (clients), R4 (non-client). R2 brings in an eBGP route 10.50.0.0/16. Goal: get the route everywhere without full-mesh.

اقداماتStepsSteps

Step 1

مسئلہ سمجھیں۔ iBGP میں split-horizon rule ہے: ایک iBGP نیبر سے سیکھا راستہ دوسرے iBGP نیبر کو نہیں بتایا جاتا۔ اسی لیے full-mesh چاہیے ہوتا ہے — جو بڑے نیٹ ورک میں ناقابل عمل ہے۔Masla samjhein. iBGP mein split-horizon rule hai: ek iBGP neighbor se seekha rasta doosre iBGP neighbor ko nahi bataya jata. Isi liye full-mesh chahiye hota hai — jo bare network mein naqabil-e-amal hai.Understand the problem. iBGP has a split-horizon rule: a route learned from one iBGP neighbor is not told to another iBGP neighbor. That's why full-mesh is needed — impractical in large networks.

show ip bgp summary

Step 2

R1 کو Route Reflector بنائیں۔ neighbor route-reflector-client کمانڈ سے R2 اور R3 کو clients بنائیں۔ R4 کو non-client رہنے دیں۔R1 ko Route Reflector banayein. neighbor route-reflector-client command se R2 aur R3 ko clients banayein. R4 ko non-client rehne dein.Make R1 a Route Reflector. Use neighbor route-reflector-client to make R2 and R3 clients. Leave R4 as non-client.

configure terminal
router bgp 65001
neighbor 192.168.12.2 remote-as 65001
neighbor 192.168.12.2 route-reflector-client
neighbor 192.168.13.3 remote-as 65001
neighbor 192.168.13.3 route-reflector-client
neighbor 192.168.14.4 remote-as 65001
exit

Step 3

Reflection rules دیکھیں۔ RR client سے آیا راستہ سب کو (clients + non-clients) بتاتا ہے۔ Non-client سے آیا راستہ صرف clients کو بتاتا ہے۔ eBGP سے آیا راستہ سب کو بتاتا ہے۔Reflection rules dekhein. RR client se aaya rasta sab ko (clients + non-clients) batata hai. Non-client se aaya rasta sirf clients ko batata hai. eBGP se aaya rasta sab ko batata hai.Observe the reflection rules. The RR tells a client-learned route to everyone (clients + non-clients). A non-client-learned route goes only to clients. An eBGP-learned route goes to everyone.

show ip bgp 10.50.0.0

Step 4

Prefix-list سے فلٹرنگ کریں۔ R1 پر prefix-list بنا کر R4 کو صرف مخصوص prefixes بھیجیں۔ neighbor prefix-list OUT سمت میں لگتی ہے۔Prefix-list se filtering karein. R1 par prefix-list bana kar R4 ko sirf makhsoos prefixes bhejein. neighbor prefix-list OUT simt mein lagti hai.Filter with a prefix-list. On R1, build a prefix-list so R4 only receives specific prefixes. neighbor prefix-list applies in the OUT direction.

configure terminal
ip prefix-list TO-R4 seq 5 permit 10.50.0.0/16
ip prefix-list TO-R4 seq 10 deny 0.0.0.0/0 le 32
router bgp 65001
neighbor 192.168.14.4 prefix-list TO-R4 out
exit
clear ip bgp 192.168.14.4 soft out

Step 5

BGP community لگائیں۔ R2 پر route-map سے آنے والے راستے پر community 65001:100 لگائیں۔ Communities راستے کے ساتھ سفر کرتی ہیں اور دور کے راؤٹرز ان پر پالیسی لگاتے ہیں۔BGP community lagayein. R2 par route-map se aane wale raste par community 65001:100 lagayein. Communities raste ke saath safar karti hain aur door ke routers in par policy lagate hain.Apply a BGP community. On R2, use a route-map to attach community 65001:100 to the incoming route. Communities travel with the route and distant routers apply policy on them.

configure terminal
ip prefix-list CUST seq 5 permit 10.50.0.0/16
route-map SET-COMM permit 10
match ip address prefix-list CUST
set community 65001:100
exit
router bgp 65001
neighbor 203.0.113.2 route-map SET-COMM in
neighbor 203.0.113.2 send-community
exit
clear ip bgp 203.0.113.2 soft in

Step 6

Community کی بنیاد پر پالیسی لگائیں۔ R1 پر community-list بنا کر 65001:100 والے راستوں پر local-pref بڑھائیں — یہی communities کی اصل طاقت ہے۔Community ki bunyad par policy lagayein. R1 par community-list bana kar 65001:100 wale raston par local-pref barhayein — yehi communities ki asal taqat hai.Apply policy based on community. On R1, build a community-list and raise local-pref on routes with 65001:100 — this is the real power of communities.

configure terminal
ip community-list 1 permit 65001:100
route-map COMM-POLICY permit 10
match community 1
set local-preference 300
exit
router bgp 65001
neighbor 192.168.12.2 route-map COMM-POLICY in
exit
clear ip bgp * soft

Step 7

حتمی تصدیق کریں۔ show ip bgp community سے دیکھیں کہ community راستے کے ساتھ آئی ہے۔ تمام راؤٹرز پر 10.50.0.0/16 کا best path چیک کریں۔Hatmi tasdeeq karein. show ip bgp community se dekhein ke community raste ke saath aayi hai. Tamam routers par 10.50.0.0/16 ka best path check karein.Do the final verification. Use show ip bgp community to confirm the community arrived with the route. Check the best path for 10.50.0.0/16 on all routers.

show ip bgp community
show ip bgp 10.50.0.0

تصدیقVerifyVerify

R3 اور R4 کو RR کے ذریعے 10.50.0.0/16 ملنا چاہیے بغیر براہ راست iBGP پیئرنگ کے۔ Community راستے کے ساتھ نظر آنی چاہیے۔R3 aur R4 ko RR ke zariye 10.50.0.0/16 milna chahiye baghair braah-e-raast iBGP peering ke. Community raste ke saath nazar aani chahiye.R3 and R4 should receive 10.50.0.0/16 via the RR without direct iBGP peering. The community should be visible on the route.

show ip bgp summary
show ip bgp community
show ip bgp 10.50.0.0

خرابی دور کرناTroubleshootingTroubleshooting

⚠️ Client کو RR سے راستہ نہیں مل رہا۔Client ko RR se rasta nahi mil raha.The client isn't getting the route from the RR.

✅ چیک کریں کہ neighbor route-reflector-client لگا ہے، cluster-id میں کوئی conflict نہیں، اور originator-id کی وجہ سے loop سمجھ کر راستہ drop تو نہیں ہو رہا۔Check karein ke neighbor route-reflector-client laga hai, cluster-id mein koi conflict nahi, aur originator-id ki wajah se loop samajh kar rasta drop to nahi ho raha.Verify neighbor route-reflector-client is set, there's no cluster-id conflict, and the route isn't being dropped as a loop because of originator-id.

⚠️ Community راستے پر نظر نہیں آ رہی۔Community raste par nazar nahi aa rahi.The community isn't visible on the route.

✅ send-community نیبر پر لگا ہے یا نہیں چیک کریں — بغیر اس کے community بھیجی ہی نہیں جاتی۔ show ip bgp <prefix> میں community فیلڈ دیکھیں۔send-community neighbor par laga hai ya nahi check karein — baghair is ke community bheji hi nahi jati. show ip bgp <prefix> mein community field dekhein.Check send-community is on the neighbor — without it the community is never sent. Look at the community field in show ip bgp <prefix>.

انٹرویو سوالاتInterview Q&AInterview Q&A

❓ Route Reflector کیوں استعمال ہوتا ہے؟Route Reflector kyun istemal hota hai?Why is a Route Reflector used?

iBGP میں split-horizon کی وجہ سے full-mesh چاہیے ہوتا ہے (n*(n-1)/2 پیئرنگز)۔ RR یہ شرط ختم کر کے ایک مرکزی راؤٹر سے راستے reflect کرتا ہے، جس سے بڑے AS میں پیئرنگز ڈرامائی طور پر کم ہو جاتی ہیں۔iBGP mein split-horizon ki wajah se full-mesh chahiye hota hai (n*(n-1)/2 peerings). RR ye shart khatm kar ke ek markazi router se raste reflect karta hai, jis se bare AS mein peerings dramayi tor par kam ho jati hain.iBGP's split-horizon demands full-mesh (n*(n-1)/2 peerings). An RR removes that requirement by reflecting routes from one central router, dramatically cutting peerings in a large AS.

❓ BGP communities کیا ہیں اور no-export community کیا کرتی ہے؟BGP communities kya hain aur no-export community kya karti hai?What are BGP communities and what does the no-export community do?

Communities راستوں پر لگے لیبل ہیں جن پر دور کے راؤٹرز پالیسی لگاتے ہیں۔ no-export والی community والا راستہ AS سے باہر eBGP نیبرز کو advertise نہیں ہوتا۔Communities raston par lage label hain jin par door ke routers policy lagate hain. no-export wali community wala rasta AS se bahar eBGP neighbors ko advertise nahi hota.Communities are labels on routes that distant routers act upon. A route with the no-export community is not advertised to eBGP neighbors outside the AS.