NAT/PAT
CCNA 200-301 v2.0 · Live Feb 3, 2027 (v1.1 valid through Feb 2, 2027) Cisco Packet Tracer
مقصدObjectiveObjective
اس لیب میں آپ NAT کی تینوں اقسام سیکھیں گے: static NAT, dynamic NAT اور PAT (overload)۔Is lab mein aap NAT ki teeno qisam seekhenge: static NAT, dynamic NAT aur PAT (overload).In this lab you'll learn all three types of NAT: static NAT, dynamic NAT, and PAT (overload).
آسان مثالSimple AnalogySimple Analogy
آپ کے آفس کا ایک ہی باہر کا فون نمبر ہے، لیکن اندر 50 extensions ہیں۔ باہر سے کال آئے تو ریسپشنسٹ دیکھ کر صحیح extension پر بھیج دیتی ہے (PAT)۔ کبھی کسی خاص بندے کو سیدھا باہر کا نمبر دے دیا جاتا ہے (static NAT)۔ NAT یہی کام کرتا ہے: اندر کے private IPs کو باہر کے public IP میں بدلنا۔Aapke office ka ek hi bahar ka phone number hai, lekin andar 50 extensions hain. Bahar se call aaye to receptionist dekh kar sahi extension par bhej deti hai (PAT). Kabhi kisi khaas bande ko seedha bahar ka number de diya jata hai (static NAT). NAT yehi kaam karta hai: andar ke private IPs ko bahar ke public IP mein badalna.Your office has one outside phone number but 50 extensions inside. When a call comes in, the receptionist forwards it to the right extension (PAT). Sometimes a special person gets a direct outside number (static NAT). NAT does exactly this: translating inside private IPs to outside public IPs.
سیٹ اپLab SetupLab Setup
R1 کا G0/0 اندر (192.168.10.0/24)، S0/0/0 باہر (203.0.113.0/24) جہاں سرور ہے۔ Devices: 1x Router 2911 (R1), 1x Switch, 2x PC, 1x Server (باہر)۔ PC1: 192.168.10.10/24، PC2: 192.168.10.11/24، گیٹ وے 192.168.10.1۔ Server: 203.0.113.100/24۔R1 ka G0/0 andar (192.168.10.0/24), S0/0/0 bahar (203.0.113.0/24) jahan server hai. Devices: 1x Router 2911 (R1), 1x Switch, 2x PC, 1x Server (bahar) PC1: 192.168.10.10/24, PC2: 192.168.10.11/24, gateway 192.168.10.1. Server: 203.0.113.100/24.R1's G0/0 is inside (192.168.10.0/24), S0/0/0 is outside (203.0.113.0/24) where the server is. Devices: 1x Router 2911 (R1), 1x Switch, 2x PC, 1x Server (outside). PC1: 192.168.10.10/24, PC2: 192.168.10.11/24, gateway 192.168.10.1. Server: 203.0.113.100/24.
اقداماتStepsSteps
Step 1
R1 پر Static NAT۔ پہلے بتاؤ کہ کونسا interface اندر (inside) ہے اور کونسا باہر (outside)۔R1 par Static NAT. Pehle batayo ke kaunsa interface andar (inside) hai aur kaunsa bahar (outside).Static NAT on R1. First declare which interface is inside and which is outside.
enable configure terminal interface g0/0 ip nat inside exit interface s0/0/0 ip nat outside exit
Step 2
پھر static NAT: اندر کا 192.168.10.10 ہمیشہ باہر 203.0.113.10 بن کر جائے گا۔Phir static NAT: andar ka 192.168.10.10 hamesha bahar 203.0.113.10 ban kar jayegaThen static NAT: the inside 192.168.10.10 will always go out as 203.0.113.10.
ip nat inside source static 192.168.10.10 203.0.113.10
Step 3
Dynamic NAT اور PAT۔ ACL 1 سے بتاؤ کہ کونسی اندر کی network NAT کرے گی۔Dynamic NAT aur PAT. ACL 1 se batayo ke kaunsi andar ki network NAT karegi.Dynamic NAT and PAT. Use ACL 1 to say which inside network gets NATed.
access-list 1 permit 192.168.10.0 0.0.0.255
Step 4
Dynamic NAT میں pool کے IPs ملتے ہیں۔Dynamic NAT mein pool ke IPs milte hain.In dynamic NAT, IPs come from the pool.
ip nat pool PUBLIC 203.0.113.20 203.0.113.30 netmask 255.255.255.0 ip nat inside source list 1 pool PUBLIC
Step 5
PAT (overload) میں سب ایک ہی public IP سے کام چلاتے ہیں — گھر کا راؤٹر یہی کرتا ہے۔PAT (overload) mein sab ek hi public IP se kaam chalate hain — ghar ka router yehi karta haiIn PAT (overload), everyone shares a single public IP — that's what your home router does.
ip nat inside source list 1 interface s0/0/0 overload
Step 6
Testing: PC سے سرور کو ping کرو۔Testing: PC se server ko ping karo.Testing: ping the server from the PC.
Step 7
پھر show ip nat translations دیکھو — اندر کے IP باہر کے IP میں بدلے نظر آئیں گے۔Phir show ip nat translations dekho — andar ke IP bahar ke IP mein badle nazar aayenge.Then check show ip nat translations — you'll see inside IPs translated to outside IPs.
تصدیقVerifyVerify
show ip nat translations سے live mappings دیکھو۔ show ip nat statistics سے hits/misses دیکھو۔show ip nat translations se live mappings dekho. show ip nat statistics se hits/misses dekho.See live mappings with show ip nat translations. Check hits/misses with show ip nat statistics.
show ip nat translations show ip nat statistics
خرابی دور کرناTroubleshootingTroubleshooting
⚠️ NAT translations نہیں بن رہے۔NAT translations nahi ban rahe.NAT translations aren't being created.
✅ ip nat inside اور ip nat outside لگانا مت بھولو۔ اس کے بغیر NAT کام نہیں کرتا۔ip nat inside aur ip nat outside lagana mat bhoolo. Iske baghair NAT kaam nahi karta.Don't forget to set ip nat inside and ip nat outside. NAT doesn't work without them.
⚠️ کچھ PCs کا NAT ہو رہا ہے، کچھ کا نہیں۔Kuch PCs ka NAT ho raha hai, kuch ka nahi.Some PCs get NATed, others don't.
✅ ACL کا wildcard mask چیک کرو۔ 192.168.10.0 کے لیے 0.0.0.255 ہونا چاہیے۔ACL ka wildcard mask check karo. 192.168.10.0 ke liye 0.0.0.255 hona chahiye.Check the ACL's wildcard mask. For 192.168.10.0 it must be 0.0.0.255.
انٹرویو سوالاتInterview Q&AInterview Q&A
❓ Static, Dynamic NAT اور PAT میں فرق؟Static, Dynamic NAT aur PAT mein farq?What's the difference between static, dynamic NAT and PAT?
Static NAT: ایک اندر کا IP ہمیشہ ایک باہر کے IP سے map (1-to-1)۔ Dynamic NAT: pool سے جو خالی ملے۔ PAT: سب ایک ہی public IP استعمال کرتے ہیں، port numbers سے فرق ہوتا ہے۔Static NAT: ek andar ka IP hamesha ek bahar ke IP se map (1-to-1). Dynamic NAT: pool se jo khali mile. PAT: sab ek hi public IP istemal karte hain, port numbers se farq hota hai.Static NAT: one inside IP always maps to one outside IP (1-to-1). Dynamic NAT: you get whatever is free from the pool. PAT: everyone shares one public IP, separated by port numbers.