Nexus Basics: NX-OS, vPC & Port Channels

CCNP Data Center — DCCOR track EVE-NG — Nexus / ACI lab

مقصدObjectiveObjective

اس lab میں آپ NX-OS کی بنیادی commands سیکھیں گے، features enable کرنا، port channel بنانا اور دو Nexus switches کے درمیان vPC configure کرنا سیکھیں گے۔Is lab mein aap NX-OS ki bunyadi commands seekhenge, features enable karna, port channel banana aur do Nexus switches ke darmiyan vPC configure karna seekhenge.In this lab you will learn basic NX-OS commands, how to enable features, build a port channel, and configure vPC between two Nexus switches.

آسان مثالSimple AnalogySimple Analogy

vPC ایسا ہے جیسے دو جڑواں بھائی ایک ہی شناختی کارڈ پر کام کریں۔ دونوں switches الگ الگ ہیں لیکن نیٹ ورک انہیں ایک logical switch سمجھتا ہے، اس لیے سرور دونوں سے بیک وقت جڑ سکتا ہے اور کوئی loop نہیں بنتا۔vPC aisa hai jaise do jurwaan bhai ek hi shanakhti card par kaam karein. Dono switches alag alag hain lekin network unhein ek logical switch samajhta hai, is liye server dono se beek waqt jur sakta hai aur koi loop nahi banta.vPC is like twin brothers working under one identity card. The two switches are separate, but the network sees them as one logical switch, so a server can connect to both at once with no loop.

سیٹ اپLab SetupLab Setup

EVE-NG میں 2x Nexus 9000v switches (N9K-1، N9K-2)۔ دونوں کے درمیان peer-link کے لیے 2 links (Eth1/1، Eth1/2) اور mgmt0 دونوں کا management network سے connected ہو۔EVE-NG mein 2x Nexus 9000v switches (N9K-1, N9K-2). Dono ke darmiyan peer-link ke liye 2 links (Eth1/1, Eth1/2) aur mgmt0 dono ka management network se connected ho.In EVE-NG: 2x Nexus 9000v switches (N9K-1, N9K-2). Two links between them for the peer-link (Eth1/1, Eth1/2), and mgmt0 of both connected to the management network.

اقداماتStepsSteps

Step 1

NX-OS کی بنیاد (N9K-1)۔ IOS جیسی ہی commands ہیں: enable، configure terminal، hostname۔ show version سے platform confirm کریں۔NX-OS ki bunyad (N9K-1). IOS jaisi hi commands hain: enable, configure terminal, hostname. show version se platform confirm karein.NX-OS basics (N9K-1). Commands look like IOS: enable, configure terminal, hostname. Confirm the platform with show version.

enable
configure terminal
hostname N9K-1
end
show version

Step 2

NX-OS میں features ڈیفالٹ off ہوتے ہیں — انہیں پہلے on کرنا پڑتا ہے۔ LACP، vPC اور interface-vlan enable کریں۔NX-OS mein features default off hote hain — unhein pehle on karna parta hai. LACP, vPC aur interface-vlan enable karein.In NX-OS, features are off by default — you must turn them on first. Enable LACP, vPC and interface-vlan.

configure terminal
feature lacp
feature vpc
feature interface-vlan
end
show feature | include vpc

Step 3

Management IP لگائیں (دونوں switches پر، الگ الگ IP)۔ mgmt0 وہ interface ہے جس سے آپ switch کو manage کرتے ہیں۔Management IP lagayein (dono switches par, alag alag IP). mgmt0 woh interface hai jis se aap switch ko manage karte hain.Set the management IP (on both switches, different IPs). mgmt0 is the interface you use to manage the switch.

configure terminal
interface mgmt0
ip address 192.168.100.11/24
no shutdown
end
ping 192.168.100.12

Step 4

دونوں switches کے درمیان port channel بنائیں (N9K-1 پر)۔ channel-group دونوں physical links کو ایک logical link بنا دیتا ہے۔Dono switches ke darmiyan port channel banayein (N9K-1 par). channel-group dono physical links ko ek logical link bana deta hai.Build a port channel between the two switches (on N9K-1). channel-group turns both physical links into one logical link.

configure terminal
interface ethernet 1/1-2
channel-group 10 mode active
end
show port-channel summary

Step 5

vPC domain بنائیں (دونوں switches پر)۔ peer-keepalive ایک heartbeat ہے جو بتاتا ہے کہ دوسرا switch زندہ ہے۔ پھر port-channel 10 کو peer-link بنائیں۔vPC domain banayein (dono switches par). peer-keepalive ek heartbeat hai jo batata hai ke doosra switch zinda hai. Phir port-channel 10 ko peer-link banayein.Create the vPC domain (on both switches). The peer-keepalive is a heartbeat proving the other switch is alive. Then make port-channel 10 the peer-link.

configure terminal
vpc domain 10
peer-keepalive destination 192.168.100.12 source 192.168.100.11
exit
interface port-channel 10
vpc peer-link
end
show vpc brief

Step 6

اب سرور کی dual-homing: Eth1/3 پر ایک اور port channel بنا کر اسے vPC 20 دیں۔ دونوں switches پر یہی config دہرائیں۔Ab server ki dual-homing: Eth1/3 par ek aur port channel bana kar usay vPC 20 dein. Dono switches par yehi config dohrayein.Now dual-home a server: build another port channel on Eth1/3 and give it vPC 20. Repeat this config on both switches.

configure terminal
interface ethernet 1/3
channel-group 20 mode active
interface port-channel 20
switchport mode trunk
switchport trunk allowed vlan 10,20
vpc 20
end
show vpc consistency-parameters global

Step 7

تصدیق کریں: show vpc brief میں peer-link up اور peer adjacency formed نظر آنا چاہیے۔Tasdeeq karein: show vpc brief mein peer-link up aur peer adjacency formed nazar aana chahiye.Verify: show vpc brief should show the peer-link up and peer adjacency formed.

show vpc brief
show vpc peer-keepalive

تصدیقVerifyVerify

show vpc brief میں دونوں switches پر vPC peer status 'peer adjacency formed' ہونا چاہیے اور port-channel 10 کا status 'up'۔show vpc brief mein dono switches par vPC peer status 'peer adjacency formed' hona chahiye aur port-channel 10 ka status 'up'.In show vpc brief on both switches, the vPC peer status should read 'peer adjacency formed' and port-channel 10 should be 'up'.

show vpc brief
show port-channel summary

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

⚠️ vPC peer-keepalive down دکھا رہا ہے۔vPC peer-keepalive down dikha raha hai.The vPC peer-keepalive shows down.

✅ دونوں switches کے mgmt0 IPs چیک کریں اور ایک دوسرے کو ping کریں۔ اکثر peer-keepalive میں destination IP غلط لکھی ہوتی ہے۔Dono switches ke mgmt0 IPs check karein aur ek doosre ko ping karein. Aksar peer-keepalive mein destination IP ghalat likhi hoti hai.Check both switches' mgmt0 IPs and ping each other. Most often the destination IP in the peer-keepalive is typed wrong.

⚠️ vPC consistency check fail ہو رہا ہے۔vPC consistency check fail ho raha hai.The vPC consistency check is failing.

✅ دونوں switches پر VLANs، trunk allowed list اور port-channel config ایک جیسی ہونی چاہیے۔ show vpc consistency-parameters سے فرق تلاش کریں۔Dono switches par VLANs, trunk allowed list aur port-channel config ek jaisi honi chahiye. show vpc consistency-parameters se farq talash karein.VLANs, trunk allowed lists and port-channel config must match on both switches. Use show vpc consistency-parameters to find the mismatch.

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

❓ vPC کیا ہے اور کیوں استعمال ہوتا ہے؟vPC kya hai aur kyun istemal hota hai?What is vPC and why is it used?

vPC دو physical switches کو ایک logical switch بنا دیتا ہے۔ اس سے سرور دونوں switches سے active-active جڑ سکتا ہے، STP block کیے بغیر اور loop کے خطرے کے بغیر۔vPC do physical switches ko ek logical switch bana deta hai. Is se server dono switches se active-active jur sakta hai, STP block kiye baghair aur loop ke khatre ke baghair.vPC makes two physical switches appear as one logical switch. A server can then connect active-active to both, with no STP blocking and no loop risk.

❓ vPC peer-link اور peer-keepalive میں کیا فرق ہے؟vPC peer-link aur peer-keepalive mein kya farq hai?What is the difference between the vPC peer-link and the peer-keepalive?

peer-link وہ high-speed link ہے جس پر data اور sync traffic جاتا ہے۔ peer-keepalive ایک چھوٹا heartbeat ہے (عام طور پر mgmt0 پر) جو صرف یہ بتاتا ہے کہ peer زندہ ہے یا نہیں۔peer-link woh high-speed link hai jis par data aur sync traffic jata hai. peer-keepalive ek chhota heartbeat hai (aam tor par mgmt0 par) jo sirf ye batata hai ke peer zinda hai ya nahi.The peer-link is the high-speed link carrying data and sync traffic. The peer-keepalive is a small heartbeat (usually over mgmt0) that only reports whether the peer is alive.