IPv4 Addressing & Subnetting

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

مقصدObjectiveObjective

اس لیب میں آپ IPv4 ایڈریسنگ اور سب نیٹنگ کو ہاتھ سے کر کے سیکھیں گے۔ /24 نیٹ ورک کو /26 سب نیٹس میں بانٹ کر راؤٹر انٹرفیسز اور PCs پر لگائیں گے۔Is lab mein aap IPv4 addressing aur subnetting ko haath se kar ke seekhenge. /24 network ko /26 subnets mein baant kar router interfaces aur PCs par lagayenge.In this lab, you'll learn IPv4 addressing and subnetting by doing it by hand. You'll split a /24 network into /26 subnets and apply them on router interfaces and PCs.

آسان مثالSimple AnalogySimple Analogy

سوچو کہ آپ کے محلے میں ہر گھر کا ایڈریس ہے — گلی نمبر، مکان نمبر۔ IP ایڈریس بالکل یہی ہے: نیٹ ورک کا پتا۔ سب نیٹ ماسک بتاتا ہے کہ ایڈریس کا کونسا حصہ گلی (نیٹ ورک) ہے اور کونسا مکان (ہوسٹ) ہے۔ سب نیٹنگ کا مطلب ایک بڑی گلی کو چھوٹی گلیوں میں بانٹنا تاکہ ہر ڈیپارٹمنٹ کو اپنا حصہ ملے۔Socho ke aapke mohalle mein har ghar ka address hai — gali number, makan number. IP address bilkul yehi hai: network ka pata. Subnet mask batata hai ke address ka kaunsa hissa gali (network) hai aur kaunsa makan (host) hai. Subnetting ka matlab ek bari gali ko chhoti galiyon mein baantna taake har department ko apna hissa mile.Imagine every house in your neighborhood has an address — street number, house number. An IP address is exactly that: the network's address. The subnet mask tells you which part of the address is the street (network) and which part is the house (host). Subnetting means dividing one big street into smaller streets so each department gets its own part.

سیٹ اپLab SetupLab Setup

R1 کے G0/0 پر PC1 کنیکٹڈ ہے، G0/1 پر PC2 کنیکٹڈ ہے۔ دونوں الگ الگ /26 سب نیٹس میں ہیں۔ ڈیوائسز: 1x راؤٹر 2911 (R1)، 2x پی سی (PC1، PC2)۔ PC1: 192.168.10.2/26، گیٹ وے 192.168.10.1۔ PC2: 192.168.10.66/26، گیٹ وے 192.168.10.65۔ ماسک دونوں پر 255.255.255.192۔R1 ke G0/0 par PC1 connected hai, G0/1 par PC2 connected hai. Dono alag alag /26 subnets mein hain. Devices: 1x Router 2911 (R1), 2x PC (PC1, PC2) PC1: 192.168.10.2/26, gateway 192.168.10.1. PC2: 192.168.10.66/26, gateway 192.168.10.65. Mask dono par 255.255.255.192.PC1 is connected to R1's G0/0, PC2 to G0/1. Both are in separate /26 subnets. Devices: 1x Router 2911 (R1), 2x PCs (PC1, PC2). PC1: 192.168.10.2/26, gateway 192.168.10.1. PC2: 192.168.10.66/26, gateway 192.168.10.65. Mask 255.255.255.192 on both.

اقداماتStepsSteps

Step 1

راؤٹر R1 پر سب نیٹڈ IPs۔ 192.168.10.0/24 کو /26 میں بانٹا ہے — ہر سب نیٹ میں 62 usable ہوسٹس۔Router R1 par subnetted IPs. 192.168.10.0/24 ko /26 mein baanta hai — har subnet mein 62 usable hosts.Subnetted IPs on router R1. We've split 192.168.10.0/24 into /26 — 62 usable hosts per subnet.

enable
configure terminal

Step 2

G0/0 کو پہلی سب نیٹ (192.168.10.0/26) کا گیٹ وے لگاؤG0/0 ko pehli subnet (192.168.10.0/26) ka gateway lagaoGive G0/0 the gateway of the first subnet (192.168.10.0/26).

interface g0/0
ip address 192.168.10.1 255.255.255.192
no shutdown
exit

Step 3

G0/1 کو دوسری سب نیٹ (192.168.10.64/26) کا گیٹ وے لگاؤG0/1 ko doosri subnet (192.168.10.64/26) ka gateway lagaoGive G0/1 the gateway of the second subnet (192.168.10.64/26).

interface g0/1
ip address 192.168.10.65 255.255.255.192
no shutdown
exit

Step 4

PC1 پر (پہلی سب نیٹ)۔ PC کا IP اسی سب نیٹ میں ہونا چاہیے جس میں اس کا گیٹ وے ہے۔ ماسک بھی same /26 ہونا چاہیے ورنہ PC سمجھے گا کہ گیٹ وے دوسری گلی میں ہےPC1 par (pehli subnet). PC ka IP usi subnet mein hona chahiye jis mein uska gateway hai. Mask bhi same /26 hona chahiye warna PC samjhe ga ke gateway doosri gali mein haiOn PC1 (first subnet). The PC's IP must be in the same subnet as its gateway. The mask must also be the same /26, otherwise the PC will think the gateway is on a different street.

ip address 192.168.10.2
subnet mask 255.255.255.192
default gateway 192.168.10.1

Step 5

ٹیسٹنگ: PC1 سے ping 192.168.10.1 (اپنا گیٹ وے)، پھر ping 192.168.10.66 (دوسری سب نیٹ کا PC)۔ دونوں کا جواب آنا چاہیے۔Testing: PC1 se ping 192.168.10.1 (apna gateway), phir ping 192.168.10.66 (doosri subnet ka PC). Dono ka jawab aana chahiye.Testing: from PC1, ping 192.168.10.1 (its own gateway), then ping 192.168.10.66 (the PC on the other subnet). Both should reply.

Step 6

راؤٹر پر show ip interface brief سے IPs کنفرم کرو۔Router par show ip interface brief se IPs confirm karo.Confirm the IPs on the router with show ip interface brief.

تصدیقVerifyVerify

show ip interface brief سے IPs اور اسٹیٹس دیکھو۔ show ip route سے connected روٹس (C) کنفرم کرو۔show ip interface brief se IPs aur status dekho. show ip route se connected routes (C) confirm karo.Check IPs and status with show ip interface brief. Confirm the connected routes (C) with show ip route.

show ip interface brief
show ip route

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

⚠️ PC اپنے گیٹ وے کو پنگ نہیں کر پا رہا۔PC apne gateway ko ping nahi kar pa raha.The PC can't ping its own gateway.

✅ ماسک چیک کرو — PC اور گیٹ وے کا ماسک same ہونا چاہیے۔ غلط ماسک پر PC گیٹ وے کو اپنی سب نیٹ سے باہر سمجھتا ہے۔Mask check karo — PC aur gateway ka mask same hona chahiye. Ghalat mask par PC gateway ko apni subnet se bahar samajhta hai.Check the mask — the PC and gateway must have the same mask. With the wrong mask, the PC thinks the gateway is outside its subnet.

⚠️ IP لگاتے وقت 'bad mask' یا overlap کا ایرر آ رہا ہے۔IP lagane par 'bad mask' ya overlap ka error aa raha hai.Getting a 'bad mask' or overlap error when assigning the IP.

✅ Usable رینج 192.168.10.1 سے 192.168.10.62 ہے۔ 192.168.10.63 براڈکاسٹ ہے — کوئی valid IP لگاؤ۔Usable range 192.168.10.1 se 192.168.10.62 hai. 192.168.10.63 broadcast hai — koi valid IP lagao.The usable range is 192.168.10.1 to 192.168.10.62. 192.168.10.63 is the broadcast — use a valid IP.

⚠️ دوسرے انٹرفیس پر IP لگاتے وقت overlapping ایرر۔Doosre interface par IP lagate waqt overlapping error.Overlapping error when assigning an IP on the second interface.

✅ دونوں انٹرفیسز کی سب نیٹس overlap نہیں کرنی چاہئیں۔ /26 بلاکس: .0-.63، .64-.127، .128-.191، .192-.255۔Dono interfaces ki subnets overlap nahi karni chahiye. /26 blocks: .0-.63, .64-.127, .128-.191, .192-.255.The subnets on both interfaces must not overlap. /26 blocks: .0-.63, .64-.127, .128-.191, .192-.255.

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

❓ /26 سب نیٹ میں کتنے usable ہوسٹس ہوتے ہیں؟/26 subnet mein kitne usable hosts hote hain?How many usable hosts are in a /26 subnet?

/26 میں 6 ہوسٹ بٹس بچتے ہیں: 2^6 - 2 = 62 usable ہوسٹس۔/26 mein 6 host bits bachte hain: 2^6 - 2 = 62 usable hosts.A /26 leaves 6 host bits: 2^6 - 2 = 62 usable hosts.

❓ نیٹ ورک ID اور براڈکاسٹ ایڈریس کیوں اسائن نہیں کرتے؟Network ID aur broadcast address kyun assign nahi karte?Why don't we assign the network ID and broadcast address?

نیٹ ورک ID پہلا ایڈریس ہوتا ہے (سب ہوسٹ بٹس 0)، براڈکاسٹ آخری ایڈریس (سب ہوسٹ بٹس 1)۔ یہ دونوں کسی ڈیوائس کو نہیں دیے جا سکتے۔Network ID pehla address hota hai (sab host bits 0), broadcast aakhri address (sab host bits 1). Ye dono kisi device ko nahi diye ja sakte.The network ID is the first address (all host bits 0) and broadcast is the last address (all host bits 1). Neither can be given to a device.