Routing Table & Forwarding Decisions
CCNA 200-301 v2.0 · Live Feb 3, 2027 (v1.1 valid through Feb 2, 2027) Cisco Packet Tracer
مقصدObjectiveObjective
اس لیب میں آپ routing table پڑھنا سیکھیں گے — codes (C, L, S, O)، administrative distance، اور forwarding decision کیسے ہوتی ہے۔Is lab mein aap routing table parhna seekhenge — codes (C, L, S, O), administrative distance, aur forwarding decision kaise hoti hai.In this lab, you'll learn to read the routing table — the codes (C, L, S, O), administrative distance, and how forwarding decisions are made.
آسان مثالSimple AnalogySimple Analogy
راؤٹر ایک ڈاک خانہ ہے جس کے پاس ہر محلے کا نقشہ (routing table) ہے۔ جب خط (packet) آتا ہے تو وہ دیکھتا ہے: پتا کون سے محلے کا ہے؟ سب سے specific گلی کونسی ہے؟ پھر اس طرف بھیج دیتا ہے۔ اگر پتا ہی نہ ملے تو 'return to sender' (drop)۔ Routing table میں C کا مطلب 'سیدھا connected'، S کا مطلب 'static — میں نے خود لکھا'، O کا مطلب 'OSPF نے بتایا'۔Router ek dak khana hai jiske paas har mohalle ka naksha (routing table) hai. Jab khat (packet) aata hai to woh dekhta hai: pata kaun se mohalle ka hai? Sab se specific gali kaunsi hai? Phir us taraf bhej deta hai. Agar pata hi na mile to 'return to sender' (drop). Routing table mein C ka matlab 'seedha connected', S ka matlab 'static — maine khud likha', O ka matlab 'OSPF ne bataya'.A router is a post office that holds a map of every neighborhood (the routing table). When a letter (packet) arrives, it checks: which neighborhood is this address in? Which is the most specific street? Then it sends it that way. If the address isn't found at all, it's 'return to sender' (dropped). In the routing table, C means 'directly connected', S means 'static — I wrote it myself', O means 'OSPF told me'.
سیٹ اپLab SetupLab Setup
R1 کے G0/0 پر PC1 (192.168.10.0/24)، G0/1 پر PC2 (192.168.20.0/24)۔ ڈیوائسز: 1x راؤٹر 2911 (R1)، 2x پی سی۔ PC1: 192.168.10.10/24، گیٹ وے 192.168.10.1۔ PC2: 192.168.20.10/24، گیٹ وے 192.168.20.1۔R1 ke G0/0 par PC1 (192.168.10.0/24), G0/1 par PC2 (192.168.20.0/24). Devices: 1x Router 2911 (R1), 2x PC PC1: 192.168.10.10/24, gateway 192.168.10.1. PC2: 192.168.20.10/24, gateway 192.168.20.1.PC1 on R1's G0/0 (192.168.10.0/24), PC2 on G0/1 (192.168.20.0/24). Devices: 1x Router 2911 (R1), 2x PCs. PC1: 192.168.10.10/24, gateway 192.168.10.1. PC2: 192.168.20.10/24, gateway 192.168.20.1.
اقداماتStepsSteps
Step 1
R1 پر routing table پڑھو۔ کوئی کنفگ نہیں — صرف پڑھنا ہے۔R1 par routing table parho. Koi config nahi — sirf parhna hai.Read the routing table on R1. No config — just reading.
enable
Step 2
show ip route سے دیکھو کہ کون سے روٹس ہیں۔ Codes سمجھو: C=connected، L=local، S=static، O=OSPF، D=directshow ip route se dekho ke kaun se routes hain. Codes samjho: C=connected, L=local, S=static, O=OSPF, D=directUse show ip route to see which routes exist. Understand the codes: C=connected, L=local, S=static, O=OSPF, D=direct.
show ip route show ip route 192.168.20.0
Step 3
Forwarding decision ٹیسٹ کرو۔ راؤٹر سب سے لمبی match (longest prefix match) والی entry چنتا ہے۔Forwarding decision test karo. Router sab se lambi match (longest prefix match) wali entry chunta hai.Test the forwarding decision. The router picks the entry with the longest match (longest prefix match).
show ip route | include 192.168.10.0
Step 4
/25، /24 سے زیادہ specific ہے۔ یہی forwarding decision کا اصول ہے/25, /24 se zyada specific hai. Yehi forwarding decision ka usool haiA /25 is more specific than a /24. That's the rule of forwarding decisions.
ping 192.168.20.1 source 192.168.10.1
Step 5
ٹیسٹنگ: PC1 سے PC2 کو پنگ کرو اور سوچو: R1 نے پیکٹ G0/1 کی طرف کیوں بھیجا؟Testing: PC1 se PC2 ko ping karo aur socho: R1 ne packet G0/1 ki taraf kyun bheja?Testing: ping PC2 from PC1 and think: why did R1 send the packet toward G0/1?
Step 6
show ip route میں 192.168.20.0 والی لائن دیکھو — یہی جواب ہے۔show ip route mein 192.168.20.0 wali line dekho — yehi jawab hai.Look at the 192.168.20.0 line in show ip route — that's the answer.
تصدیقVerifyVerify
show ip route — ہر لائن کا code سمجھو۔ show ip route <network> سے exact match دیکھو۔show ip route — har line ka code samjho. show ip route <network> se exact match dekho.show ip route — understand each line's code. See the exact match with show ip route <network>.
show ip route show ip route 192.168.20.0
خرابی دور کرناTroubleshootingTroubleshooting
⚠️ پنگ فیل اور routing table میں destination کا route نہیں۔Ping fail aur routing table mein destination ka route nahi.Ping fails and there's no route to the destination in the routing table.
✅ اگر route ہی نہیں تو راؤٹر پیکٹ drop کر دے گا۔ Route add کرو یا connected انٹرفیس آن کرو۔Agar route hi nahi to router packet drop kar dega. Route add karo ya connected interface on karo.If there's no route at all, the router will drop the packet. Add a route or turn on the connected interface.
انٹرویو سوالاتInterview Q&AInterview Q&A
❓ Administrative Distance (AD) کیا ہے؟Administrative Distance (AD) kya hai?What is Administrative Distance (AD)?
Administrative Distance یہ بتاتا ہے کہ route کتنا قابلِ بھروسہ ہے۔ کم AD = زیادہ بھروسہ۔ Connected=0، Static=1، OSPF=110۔Administrative Distance ye batata hai ke route kitna qabil-e-bharosa hai. Kam AD = zyada bharosa. Connected=0, Static=1, OSPF=110.Administrative Distance tells you how trustworthy a route is. Lower AD = more trusted. Connected=0, Static=1, OSPF=110.
❓ راؤٹر دو ملتے جلتے routes میں سے کونسا چنتا ہے؟Router do milte julte routes mein se kaunsa chunta hai?Which route does the router pick between two similar ones?
جب دو routes same destination کے لیے ہوں تو راؤٹر سب سے لمبی prefix match (سب سے specific) والی entry چنتا ہے۔Jab do routes same destination ke liye hon to router sab se lambi prefix match (sab se specific) wali entry chunta hai.When two routes exist for the same destination, the router picks the entry with the longest prefix match (the most specific).