Native VLAN

CCNA 200-301 v2.0 · Live Feb 3, 2027 (v1.1 valid through Feb 2, 2027) Cisco Packet Tracer

مقصدObjectiveObjective

اس لیب میں آپ native VLAN کا کانسیپٹ سمجھیں گے اور اسے securely کنفیگر کرنا سیکھیں گے۔ دونوں سوئچز پر native VLAN match کرنا سب سے اہم ہے۔Is lab mein aap native VLAN ka concept samjhenge aur use securely configure karna seekhenge. Dono switches par native VLAN match karna sab se ahem hai.In this lab, you'll understand the native VLAN concept and learn to configure it securely. Matching the native VLAN on both switches is the most important part.

آسان مثالSimple AnalogySimple Analogy

ٹرنک والی روڈ پر ایک گاڑی ایسی ہے جس پر کوئی اسٹیکر نہیں لگا — وہ native VLAN کی گاڑی ہے۔ سوئچ اسے ڈیفالٹ سمجھ کر آگے بھیج دیتا ہے۔ مسئلہ یہ ہے کہ اگر دونوں بلڈنگز میں 'بغیر اسٹیکر والی گاڑی' کا مطلب الگ ہو تو گڑبڑ ہو جاتی ہے۔ اس لیے native VLAN دونوں طرف same ہونی چاہیے، اور بہتر ہے کہ اسے کسی unused VLAN پر سیٹ کر دو تاکہ کوئی غلط استعمال نہ کر سکے۔Trunk wali road par ek gaari aisi hai jis par koi sticker nahi laga — wo native VLAN ki gaari hai. Switch usay default samajh kar aagay bhej deta hai. Masla ye hai ke agar dono buildings mein 'bina sticker wali gaari' ka matlab alag ho to gadbad ho jati hai. Is liye native VLAN dono taraf same honi chahiye, aur behtar hai ke use kisi unused VLAN par set kar do taake koi ghalat istemal na kar sake.On the trunk road there's one vehicle with no sticker — that's the native VLAN's vehicle. The switch treats it as default and forwards it. The problem is that if 'the vehicle with no sticker' means something different in each building, things go wrong. So the native VLAN must be the same on both sides, and it's better to set it to an unused VLAN so nobody can misuse it.

سیٹ اپLab SetupLab Setup

SW1 Fa0/1 ٹرنک سے SW2 Fa0/1 سے کنیکٹڈ۔ دونوں طرف native VLAN 99 سیٹ کرنی ہے۔ ڈیوائسز: 2x سوئچ 2960 (SW1، SW2)، 2x پی سی۔ PC1: 192.168.10.10/24، PC2: 192.168.10.11/24۔ دونوں VLAN 10 میں ہیں۔SW1 Fa0/1 trunk se SW2 Fa0/1 se connected. Dono taraf native VLAN 99 set karni hai. Devices: 2x Switch 2960 (SW1, SW2), 2x PC PC1: 192.168.10.10/24, PC2: 192.168.10.11/24. Dono VLAN 10 mein hain.SW1 Fa0/1 connects via trunk to SW2 Fa0/1. Native VLAN 99 must be set on both sides. Devices: 2x Switch 2960 (SW1, SW2), 2x PCs. PC1: 192.168.10.10/24, PC2: 192.168.10.11/24. Both are in VLAN 10.

اقداماتStepsSteps

Step 1

SW1 پر native VLAN سیٹ کرو۔ پہلے ایک unused VLAN (99) بناتے ہیں۔SW1 par native VLAN set karo. Pehle ek unused VLAN (99) banate hain.Set the native VLAN on SW1. First create an unused VLAN (99).

enable
configure terminal
vlan 99
name NATIVE_UNUSED
exit

Step 2

پھر ٹرنک پر native VLAN 99 سیٹ کرتے ہیں۔ اب untagged ٹریفک VLAN 99 میں جائے گا جو کہیں استعمال نہیں ہوتی — محفوظ۔Phir trunk par native VLAN 99 set karte hain. Ab untagged traffic VLAN 99 mein jayega jo kahin istemal nahi hoti — mehfooz.Then set native VLAN 99 on the trunk. Now untagged traffic goes into VLAN 99, which isn't used anywhere — secure.

interface fa0/1
switchport mode trunk
switchport trunk native vlan 99
exit

Step 3

SW2 پر بھی same native VLAN۔SW2 par bhi same native VLAN.The same native VLAN on SW2.

enable
configure terminal
vlan 99
name NATIVE_UNUSED
exit

Step 4

دوسری طرف بھی EXACT same native VLAN ہونی چاہیے۔ اگر SW1 پر 99 اور SW2 پر 1 ہو تو سوئچ ایرر دے گا: 'native VLAN mismatch'Doosri taraf bhi EXACT same native VLAN honi chahiye. Agar SW1 par 99 aur SW2 par 1 ho to switch error dega: 'native VLAN mismatch'The other side must have the EXACT same native VLAN. If SW1 has 99 and SW2 has 1, the switch will report an error: 'native VLAN mismatch'.

interface fa0/1
switchport mode trunk
switchport trunk native vlan 99
exit

Step 5

ٹیسٹنگ: PC1 سے PC2 کو پنگ کرو — ٹرنک کے تھرو جانا چاہیے۔Testing: PC1 se PC2 ko ping karo — trunk ke through jana chahiye.Testing: ping PC2 from PC1 — it should go through the trunk.

Step 6

پھر ایک سوئچ پر native VLAN بدل کر دیکھو کہ CDP mismatch کا میسج آتا ہے، پھر واپس 99 کر دو۔Phir ek switch par native VLAN badal kar dekho ke CDP mismatch ka message aata hai, phir wapas 99 kar do.Then change the native VLAN on one switch and watch for the CDP mismatch message, then set it back to 99.

تصدیقVerifyVerify

show interfaces fa0/1 trunk — 'Native VLAN' والی لائن دیکھو۔ show interfaces fa0/1 switchport سے بھی تصدیق ہوتی ہے۔show interfaces fa0/1 trunk — 'Native VLAN' wali line dekho. show interfaces fa0/1 switchport se bhi tasdeeq hoti hai.show interfaces fa0/1 trunk — look at the 'Native VLAN' line. show interfaces fa0/1 switchport also confirms it.

show interfaces trunk
show interfaces fa0/1 switchport

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

⚠️ CDP 'native VLAN mismatch' کا ایرر دے رہا ہے۔CDP 'native VLAN mismatch' ka error de raha hai.CDP is reporting a 'native VLAN mismatch' error.

✅ دونوں طرف switchport trunk native vlan کمانڈ سے same VLAN سیٹ کرو۔Dono taraf switchport trunk native vlan command se same VLAN set karo.Set the same VLAN on both sides with the switchport trunk native vlan command.

⚠️ پتا نہیں کونسی VLAN native کے لیے استعمال کروں۔Pata nahi kaunsi VLAN native ke liye istemal karun.Not sure which VLAN to use as native.

✅ Native VLAN کے لیے ایسی VLAN چنو جو کہیں assign نہ ہو — جیسے 99 یا 999۔ show vlan brief سے چیک کرو۔Native VLAN ke liye aisi VLAN chuno jo kahin assign na ho — jaise 99 ya 999. show vlan brief se check karo.Pick a VLAN for native that isn't assigned anywhere — like 99 or 999. Check with show vlan brief.

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

❓ Native VLAN mismatch سے کیا ہوتا ہے؟Native VLAN mismatch se kya hota hai?What happens with a native VLAN mismatch?

جب ٹرنک کے دونوں سروں پر native VLAN الگ ہو تو CDP 'native VLAN mismatch' کا ایرر دیتا ہے اور ٹریفک غلط VLAN میں جا سکتا ہے۔Jab trunk ke dono siron par native VLAN alag ho to CDP 'native VLAN mismatch' ka error deta hai aur traffic ghalat VLAN mein ja sakta hai.When the native VLAN differs on both ends of a trunk, CDP reports a 'native VLAN mismatch' error and traffic can end up in the wrong VLAN.

❓ Native VLAN کو unused VLAN پر کیوں سیٹ کرتے ہیں؟Native VLAN ko unused VLAN par kyun set karte hain?Why set the native VLAN to an unused VLAN?

کیونکہ ڈیفالٹ native VLAN 1 ہوتی ہے اور VLAN 1 پر اکثر مینجمنٹ ٹریفک ہوتا ہے۔ Unused VLAN پر سیٹ کرنے سے VLAN hopping attacks مشکل ہو جاتے ہیں۔Kyunki default native VLAN 1 hoti hai aur VLAN 1 par aksar management traffic hota hai. Unused VLAN par set karne se VLAN hopping attacks mushkil ho jate hain.Because the default native VLAN is 1, and VLAN 1 often carries management traffic. Setting it to an unused VLAN makes VLAN hopping attacks harder.