VLAN Trunking (802.1Q)
CCNA 200-301 v2.0 · Live Feb 3, 2027 (v1.1 valid through Feb 2, 2027) Cisco Packet Tracer
مقصدObjectiveObjective
اس لیب میں آپ دو سوئچز کے درمیان ٹرنک لنک بنانا سیکھیں گے۔ 802.1Q ٹیگنگ سے multiple VLANs کا ٹریفک ایک ہی کیبل پر جائے گا۔Is lab mein aap do switches ke darmiyan trunk link banana seekhenge. 802.1Q tagging se multiple VLANs ka traffic ek hi cable par jayega.In this lab, you'll learn to build a trunk link between two switches. With 802.1Q tagging, traffic from multiple VLANs travels over a single cable.
آسان مثالSimple AnalogySimple Analogy
دو بلڈنگز کے درمیان ایک ہی روڈ ہے، لیکن اس پر الگ الگ ڈیپارٹمنٹس کی گاڑیاں چلتی ہیں۔ ہر گاڑی پر ایک اسٹیکر لگا ہے کہ یہ Sales کی ہے یا Accounts کی — تاکہ دوسری بلڈنگ میں صحیح ڈیپارٹمنٹ تک پہنچے۔ ٹرنک لنک یہی روڈ ہے، اور 802.1Q ٹیگنگ وہی اسٹیکر ہے جو ہر فریم پر VLAN نمبر لکھتا ہے۔Do buildings ke darmiyan ek hi road hai, lekin us par alag alag departments ki gaariyan chalti hain. Har gaari par ek sticker laga hai ke ye Sales ki hai ya Accounts ki — taake doosri building mein sahi department tak pahunche. Trunk link yahi road hai, aur 802.1Q tagging wohi sticker hai jo har frame par VLAN number likhta hai.There's one road between two buildings, but vehicles from different departments drive on it. Each vehicle has a sticker saying whether it's Sales or Accounts — so it reaches the right department in the other building. The trunk link is that road, and 802.1Q tagging is the sticker that writes the VLAN number on each frame.
سیٹ اپLab SetupLab Setup
SW1 کا Fa0/1، SW2 کے Fa0/1 سے کنیکٹڈ ہے (ٹرنک)۔ SW1: Fa0/2=PC1 (VLAN10)، Fa0/4=PC2 (VLAN20)۔ SW2: Fa0/2=PC3 (VLAN10)، Fa0/4=PC4 (VLAN20)۔ ڈیوائسز: 2x سوئچ 2960 (SW1، SW2)، 4x پی سی۔ PC1: 192.168.10.10/24، PC3: 192.168.10.11/24 (دونوں VLAN 10)۔ PC2: 192.168.20.10/24، PC4: 192.168.20.11/24 (دونوں VLAN 20)۔SW1 ka Fa0/1, SW2 ke Fa0/1 se connected hai (trunk). SW1: Fa0/2=PC1 (VLAN10), Fa0/4=PC2 (VLAN20). SW2: Fa0/2=PC3 (VLAN10), Fa0/4=PC4 (VLAN20). Devices: 2x Switch 2960 (SW1, SW2), 4x PC PC1: 192.168.10.10/24, PC3: 192.168.10.11/24 (dono VLAN 10). PC2: 192.168.20.10/24, PC4: 192.168.20.11/24 (dono VLAN 20).SW1's Fa0/1 connects to SW2's Fa0/1 (trunk). SW1: Fa0/2=PC1 (VLAN10), Fa0/4=PC2 (VLAN20). SW2: Fa0/2=PC3 (VLAN10), Fa0/4=PC4 (VLAN20). Devices: 2x Switch 2960 (SW1, SW2), 4x PCs. PC1: 192.168.10.10/24, PC3: 192.168.10.11/24 (both VLAN 10). PC2: 192.168.20.10/24, PC4: 192.168.20.11/24 (both VLAN 20).
اقداماتStepsSteps
Step 1
SW1 پر ٹرنک بناؤ۔ Fa0/1 کو ٹرنک بناتے ہیں تاکہ یہ VLAN 10 اور 20 دونوں کا ٹریفک لے جا سکے۔SW1 par trunk banao. Fa0/1 ko trunk banate hain taake ye VLAN 10 aur 20 dono ka traffic le ja sake.Build the trunk on SW1. We make Fa0/1 a trunk so it can carry traffic for both VLAN 10 and VLAN 20.
enable configure terminal
Step 2
allowed vlan سے ہم بتاتے ہیں کہ کون سے VLANs اس ٹرنک پر جا سکتے ہیںallowed vlan se hum batate hain ke kaun se VLANs is trunk par ja sakte hainWith allowed vlan we specify which VLANs may use this trunk.
interface fa0/1 switchport mode trunk switchport trunk allowed vlan 10,20 exit
Step 3
SW2 پر VLANs + ٹرنک۔ دوسرے سوئچ پر بھی وہی VLANs بنانے پڑتے ہیں — VLAN نمبر دونوں طرف same ہونے چاہئیں۔SW2 par VLANs + trunk. Doosre switch par bhi wohi VLANs banane parte hain — VLAN number dono taraf same hone chahiye.VLANs + trunk on SW2. You must create the same VLANs on the other switch too — the VLAN numbers must match on both sides.
enable configure terminal vlan 10 name SALES vlan 20 name ACCOUNTS exit
Step 4
پھر ٹرنک لگاؤ اور PCs والے پورٹس access میں ڈالوPhir trunk lagao aur PCs wale ports access mein daaloThen apply the trunk and put the PC ports into access mode.
interface fa0/1 switchport mode trunk switchport trunk allowed vlan 10,20 exit interface range fa0/2 - 3 switchport mode access switchport access vlan 10 exit
Step 5
ٹیسٹنگ: PC1 سے ping 192.168.10.11 — دوسرے سوئچ تک ٹرنک کے تھرو جانا چاہیے۔Testing: PC1 se ping 192.168.10.11 — doosre switch tak trunk ke through jana chahiye.Testing: from PC1, ping 192.168.10.11 — it should reach the other switch through the trunk.
Step 6
PC1 سے ping 192.168.20.10 فیل ہونا چاہیے (الگ VLAN)۔PC1 se ping 192.168.20.10 fail hona chahiye (alag VLAN).From PC1, ping 192.168.20.10 should fail (different VLAN).
تصدیقVerifyVerify
show interfaces trunk سے ٹرنک اسٹیٹس اور allowed VLANs دیکھو۔ show interfaces fa0/1 switchport سے ڈیٹیل کنفرم کرو۔show interfaces trunk se trunk status aur allowed VLANs dekho. show interfaces fa0/1 switchport se detail confirm karo.Check trunk status and allowed VLANs with show interfaces trunk. Confirm details with show interfaces fa0/1 switchport.
show interfaces trunk show interfaces fa0/1 switchport
خرابی دور کرناTroubleshootingTroubleshooting
⚠️ ٹرنک لنک کام نہیں کر رہا۔Trunk link kaam nahi kar raha.The trunk link isn't working.
✅ دونوں طرف switchport mode trunk ہونا چاہیے۔ show interfaces trunk سے اسٹیٹس دیکھو۔Dono taraf switchport mode trunk hona chahiye. show interfaces trunk se status dekho.Both sides must be in switchport mode trunk. Check status with show interfaces trunk.
⚠️ Same VLAN کے PCs دوسرے سوئچ پر پنگ نہیں کر پا رہے۔Same VLAN ke PCs doosre switch par ping nahi kar pa rahe.PCs in the same VLAN can't ping each other across switches.
✅ دونوں سوئچز پر VLANs کے نمبر same ہونے چاہئیں۔ SW2 پر VLAN 10/20 بنے ہوں ضروری ہیں۔Dono switches par VLANs ke number same hone chahiye. SW2 par VLAN 10/20 bane hon zaroori hain.VLAN numbers must be the same on both switches. VLAN 10/20 must exist on SW2.
⚠️ ٹرنک up ہے لیکن VLAN کا ٹریفک نہیں جا رہا۔Trunk up hai lekin VLAN ka traffic nahi ja raha.The trunk is up but VLAN traffic isn't passing.
✅ show interfaces fa0/1 trunk سے دیکھو کہ allowed لسٹ میں VLANs ہیں۔ ضرورت ہو تو switchport trunk allowed vlan add کرو۔show interfaces fa0/1 trunk se dekho ke allowed list mein VLANs hain. Zaroorat ho to switchport trunk allowed vlan add karo.Check show interfaces fa0/1 trunk to see the VLANs are in the allowed list. If needed, add them with switchport trunk allowed vlan add.
انٹرویو سوالاتInterview Q&AInterview Q&A
❓ 802.1Q ٹیگنگ کیا کرتی ہے؟802.1Q tagging kya karti hai?What does 802.1Q tagging do?
802.1Q فریم کے ہیڈر میں 4-بائٹ کا ٹیگ لگاتا ہے جس میں VLAN ID ہوتا ہے۔ یہی ٹیگ سوئچ کو بتاتا ہے کہ فریم کون سے VLAN کا ہے۔802.1Q frame ke header mein 4-byte ka tag lagata hai jismein VLAN ID hota hai. Yehi tag switch ko batata hai ke frame kaun se VLAN ka hai.802.1Q adds a 4-byte tag in the frame header containing the VLAN ID. That tag tells the switch which VLAN the frame belongs to.
❓ Native VLAN کیا ہوتی ہے؟Native VLAN kya hoti hai?What is the native VLAN?
Native VLAN کا ٹریفک ٹرنک پر بغیر ٹیگ کے جاتا ہے۔ ڈیفالٹ VLAN 1 ہوتی ہے۔ سیکیورٹی کے لیے اسے unused VLAN پر سیٹ کرتے ہیں۔Native VLAN ka traffic trunk par bina tag ke jata hai. Default VLAN 1 hoti hai. Security ke liye ise unused VLAN par set karte hain.Native VLAN traffic travels untagged over the trunk. The default is VLAN 1. For security, we set it to an unused VLAN.