STP Protection Features
CCNA 200-301 v2.0 · Live Feb 3, 2027 (v1.1 valid through Feb 2, 2027) Cisco Packet Tracer
مقصدObjectiveObjective
اس لیب میں آپ STP کے protection فیچرز سیکھیں گے — PortFast، BPDU Guard/Filter، Root Guard اور Loop Guard۔ یہ v2.0 میں واضح طور پر شامل ہیں۔Is lab mein aap STP ke protection features seekhenge — PortFast, BPDU Guard/Filter, Root Guard aur Loop Guard. Ye v2.0 mein wazeh tor par shamil hain.In this lab, you'll learn STP's protection features — PortFast, BPDU Guard/Filter, Root Guard, and Loop Guard. These are explicitly included in v2.0.
آسان مثالSimple AnalogySimple Analogy
STP پولیس والا ہے، لیکن اسے بھی helpers چاہئیں۔ PortFast کہتا ہے: 'یہ پورٹ PC کا ہے، یہاں سوئچ نہیں لگے گا — فوراً کھول دو، 30 سیکنڈ wait مت کرو۔' BPDU Guard کہتا ہے: 'اگر اس PC والے پورٹ پر کسی نے سوئچ لگا دیا تو پورٹ بند کر دو — کوئی نیا پولیس والا نہیں آئے گا۔' Root Guard کہتا ہے: 'اس پورٹ سے کوئی اپنے آپ کو root declare نہیں کر سکتا۔' Loop Guard کہتا ہے: 'اگر BPDU آنا بند ہو جائے تو پورٹ کو loop میں مت ڈالو۔'STP police wala hai, lekin usay bhi helpers chahiye. PortFast kehta hai: 'ye port PC ka hai, yahan switch nahi lagega — foran khol do, 30 second wait mat karo.' BPDU Guard kehta hai: 'agar is PC wale port par kisi ne switch laga diya to port band kar do — koi naya police wala nahi aayega.' Root Guard kehta hai: 'is port se koi apne aap ko root declare nahi kar sakta.' Loop Guard kehta hai: 'agar BPDU aana band ho jaye to port ko loop mein mat daalo.'STP is the officer, but it needs helpers too. PortFast says: 'This port is a PC's — no switch will connect here — open it immediately, don't wait 30 seconds.' BPDU Guard says: 'If someone plugs a switch into this PC port, shut the port down — no new officer is coming.' Root Guard says: 'No one may declare itself root through this port.' Loop Guard says: 'If BPDUs stop arriving, don't put the port into a loop.'
سیٹ اپLab SetupLab Setup
SW1-SW2 کے درمیان ٹرنک لنکس۔ Fa0/2-10 access پورٹس (PCs)، Fa0/1 اپ لنک، Fa0/24 redundant لنک۔ ڈیوائسز: 2x سوئچ 2960 (SW1، SW2)، 2x پی سی۔ PC1: 192.168.10.10/24، PC2: 192.168.10.11/24۔ دونوں VLAN 10 میں۔SW1-SW2 ke darmiyan trunk links. Fa0/2-10 access ports (PCs), Fa0/1 uplink, Fa0/24 redundant link. Devices: 2x Switch 2960 (SW1, SW2), 2x PC PC1: 192.168.10.10/24, PC2: 192.168.10.11/24. Dono VLAN 10 mein.Trunk links between SW1-SW2. Fa0/2-10 are access ports (PCs), Fa0/1 is the uplink, Fa0/24 the redundant link. Devices: 2x Switch 2960 (SW1, SW2), 2x PCs. PC1: 192.168.10.10/24, PC2: 192.168.10.11/24. Both in VLAN 10.
اقداماتStepsSteps
Step 1
Access پورٹس پر PortFast + BPDU Guard۔ PCs والے پورٹس پر PortFast لگاتے ہیں تاکہ پورٹ فوراً forwarding میں آئے۔Access ports par PortFast + BPDU Guard. PCs wale ports par PortFast lagate hain taake port foran forwarding mein aaye.PortFast + BPDU Guard on access ports. We apply PortFast on PC ports so the port goes to forwarding immediately.
enable configure terminal interface range fa0/2 - 10 spanning-tree portfast
Step 2
ساتھ BPDU Guard تاکہ اگر کوئی سوئچ لگا دے تو پورٹ خود بند ہو جائے۔Saath BPDU Guard taake agar koi switch laga de to port khud band ho jaye.Plus BPDU Guard so the port shuts itself down if someone plugs in a switch.
spanning-tree bpduguard enable exit
Step 3
Root Guard، Loop Guard، BPDU Filter۔ اپ لنک پر Root Guard (کوئی دوسرا root نہ بن سکے)۔Root Guard, Loop Guard, BPDU Filter. Uplink par Root Guard (koi doosra root na ban sake).Root Guard, Loop Guard, BPDU Filter. Root Guard on the uplink (so no other switch can become root).
interface fa0/1 spanning-tree guard root exit
Step 4
redundant لنک پر Loop Guard (BPDU غائب ہوں تو loop نہ بنے)۔Redundant link par Loop Guard (BPDU ghaib hon to loop na bane).Loop Guard on the redundant link (so no loop forms if BPDUs disappear).
interface fa0/24 spanning-tree guard loop exit
Step 5
BPDU Filter BPDU بھیجنا روکتا ہے — صرف خاص cases میں استعمال کرو۔BPDU Filter BPDU bhejna rokta hai — sirf khaas cases mein istemal karo.BPDU Filter stops sending BPDUs — use only in special cases.
interface fa0/11 spanning-tree bpdufilter enable exit
Step 6
ٹیسٹنگ: PC کا کیبل نکالو اور دوبارہ لگاؤ — پورٹ فوراً up ہونا چاہیے (PortFast کا کمال)۔Testing: PC ka cable nikalo aur dobara lagao — port foran up hona chahiye (PortFast ka kamal).Testing: unplug the PC's cable and plug it back in — the port should come up immediately (that's PortFast at work).
Step 7
show spanning-tree interface fa0/2 detail سے PortFast اسٹیٹس دیکھو۔show spanning-tree interface fa0/2 detail se PortFast status dekho.Check the PortFast status with show spanning-tree interface fa0/2 detail.
تصدیقVerifyVerify
show spanning-tree interface fa0/2 detail سے PortFast اور guards دیکھو۔ show spanning-tree inconsistentports سے violations دیکھو۔show spanning-tree interface fa0/2 detail se PortFast aur guards dekho. show spanning-tree inconsistentports se violations dekho.Check PortFast and the guards with show spanning-tree interface fa0/2 detail. Check violations with show spanning-tree inconsistentports.
show spanning-tree interface fa0/2 detail show spanning-tree inconsistentports
خرابی دور کرناTroubleshootingTroubleshooting
⚠️ پورٹ لگاتے ہی errdisable ہو گیا۔Port lagate hi errdisable ho gaya.The port went errdisable as soon as it was connected.
✅ PortFast + BPDU Guard صرف access پورٹس (PC/printer) پر لگاؤ۔ ٹرنک/اپ لنک پر لگانے سے پورٹ errdisable ہو جائے گا۔PortFast + BPDU Guard sirf access ports (PC/printer) par lagao. Trunk/uplink par lagane se port errdisable ho jayega.Apply PortFast + BPDU Guard only on access ports (PC/printer). Applying them on a trunk/uplink will err-disable the port.
⚠️ BPDU Guard نے پورٹ بند کر دیا، واپس کیسے کھولوں؟BPDU Guard ne port band kar diya, wapas kaise kholun?BPDU Guard shut the port — how do I reopen it?
✅ Errdisable سے نکلنے کے لیے: shutdown پھر no shutdown کرو۔ مستقل حل کے لیے errdisable recovery کنفیگر کرو۔Errdisable se nikalne ke liye: shutdown phir no shutdown karo. Mustaqil hal ke liye errdisable recovery configure karo.To recover from errdisable: type shutdown then no shutdown. For a permanent fix, configure errdisable recovery.
انٹرویو سوالاتInterview Q&AInterview Q&A
❓ PortFast کیا کرتا ہے اور کہاں لگانا چاہیے؟PortFast kya karta hai aur kahan lagana chahiye?What does PortFast do, and where should it be applied?
PortFast access پورٹ کو listening/learning اسٹیٹس skip کرا کے فوراً forwarding میں لے آتا ہے۔ صرف اینڈ-ڈیوائس پورٹس پر لگاؤ — سوئچ والے پورٹ پر لگانا خطرناک ہے۔PortFast access port ko listening/learning states skip kara ke foran forwarding mein le aata hai. Sirf end-device ports par lagao — switch wale port par lagana khatarnak hai.PortFast skips the listening/learning states and brings an access port to forwarding immediately. Apply it only on end-device ports — using it on a switch port is dangerous.
❓ BPDU Guard اور BPDU Filter میں فرق؟BPDU Guard aur BPDU Filter mein farq?What's the difference between BPDU Guard and BPDU Filter?
BPDU Guard پورٹ کو errdisable کر دیتا ہے (بند)۔ BPDU Filter BPDUs کو روکتا/فلٹر کرتا ہے لیکن پورٹ چلتا رہتا ہے۔ Guard زیادہ سخت ہے۔BPDU Guard port ko errdisable kar deta hai (band). BPDU Filter BPDUs ko rokta/filter karta hai lekin port chalta rehta hai. Guard zyada sakht hai.BPDU Guard err-disables the port (shuts it). BPDU Filter stops/filters BPDUs but the port keeps running. Guard is stricter.