اس لیب میں آپ inter-VLAN روٹنگ سیکھیں گے — router-on-a-stick طریقے سے۔ ایک ہی راؤٹر انٹرفیس پر sub-interfaces بنا کر الگ VLANs کو آپس میں ملائیں گے۔
Is lab mein aap inter-VLAN routing seekhenge — router-on-a-stick tareeqe se. Ek hi router interface par sub-interfaces bana kar alag VLANs ko aapas mein milayenge.
In this lab, you'll learn inter-VLAN routing — the router-on-a-stick way. You'll create sub-interfaces on a single router interface to connect separate VLANs together.
دو الگ محلے (VLANs) کے درمیان کوئی سیدھا راستہ نہیں — لیکن ایک چوکیدار (راؤٹر) ہے جس کے پاس دونوں محلوں کی چابیاں ہیں۔ ہر محلے کا ایک دروازہ راؤٹر کے ایک 'virtual' حصے سے جڑا ہے۔ Router-on-a-stick میں ایک ہی فزیکل کیبل پر راؤٹر کے اندر ورچوئل دروازے (sub-interfaces) بنتے ہیں — ہر VLAN کے لیے ایک۔
Do alag mohallon (VLANs) ke darmiyan koi seedha rasta nahi — lekin ek chowkidar (router) hai jiske paas dono mohallon ki chabiyan hain. Har mohalle ka ek darwaza router ke ek 'virtual' hisse se jura hai. Router-on-a-stick mein ek hi physical cable par router ke andar virtual darwaze (sub-interfaces) bante hain — har VLAN ke liye ek.
There is no direct road between two separate neighborhoods (VLANs) — but there's a guard (the router) who holds the keys to both. Each neighborhood's gate connects to a 'virtual' part of the router. In router-on-a-stick, virtual gates (sub-interfaces) are built inside the router over a single physical cable — one per VLAN.

R1 کا G0/0، SW1 کے Fa0/1 (ٹرنک) سے کنیکٹڈ۔ SW1: Fa0/2-3 = VLAN 10 (PC1، PC2)، Fa0/4-5 = VLAN 20 (PC3، PC4)۔ ڈیوائسز: 1x راؤٹر 2911 (R1)، 1x سوئچ 2960 (SW1)، 4x پی سی۔ PC1/PC2: 192.168.10.10، .11/24، گیٹ وے 192.168.10.1۔ PC3/PC4: 192.168.20.10، .11/24، گیٹ وے 192.168.20.1۔
R1 ka G0/0, SW1 ke Fa0/1 (trunk) se connected. SW1: Fa0/2-3 = VLAN 10 (PC1, PC2), Fa0/4-5 = VLAN 20 (PC3, PC4). Devices: 1x Router 2911 (R1), 1x Switch 2960 (SW1), 4x PC PC1/PC2: 192.168.10.10, .11/24, gateway 192.168.10.1. PC3/PC4: 192.168.20.10, .11/24, gateway 192.168.20.1.
R1's G0/0 connects to SW1's Fa0/1 (trunk). SW1: Fa0/2-3 = VLAN 10 (PC1, PC2), Fa0/4-5 = VLAN 20 (PC3, PC4). Devices: 1x Router 2911 (R1), 1x Switch 2960 (SW1), 4x PCs. PC1/PC2: 192.168.10.10, .11/24, gateway 192.168.10.1. PC3/PC4: 192.168.20.10, .11/24, gateway 192.168.20.1.
راؤٹر R1 پر sub-interfaces۔ G0/0 پر دو sub-interfaces بناتے ہیں: .10 اور .20۔
Router R1 par sub-interfaces. G0/0 par do sub-interfaces banate hain: .10 aur .20.
Sub-interfaces on router R1. We create two sub-interfaces on G0/0: .10 and .20.
enableconfigure terminalinterface fa0/0no shutdownexitہر ایک پر encapsulation dot1Q سے بتاتے ہیں کہ یہ کون سے VLAN کا دروازہ ہے، پھر اس VLAN کا گیٹ وے IP لگاتے ہیں۔
Har ek par encapsulation dot1Q se batate hain ke ye kaun se VLAN ka darwaza hai, phir us VLAN ka gateway IP lagate hain.
On each we use encapsulation dot1Q to say which VLAN's gate it is, then assign that VLAN's gateway IP.
interface fa0/0.10encapsulation dot1Q 10ip address 192.168.10.1 255.255.255.0exitinterface fa0/0.20encapsulation dot1Q 20ip address 192.168.20.1 255.255.255.0exitسوئچ SW1 پر ٹرنک + access پورٹس۔ راؤٹر کی طرف جانے والا پورٹ ٹرنک ہوگا (دونوں VLANs کا ٹریفک)۔
Switch SW1 par trunk + access ports. Router ki taraf jane wala port trunk hoga (dono VLANs ka traffic).
Trunk + access ports on switch SW1. The port toward the router will be a trunk (traffic for both VLANs).
enableconfigure terminalinterface fa0/1switchport mode trunkexitPCs والے پورٹس access میں اپنے اپنے VLAN میں۔
PCs wale ports access mein apne apne VLAN mein.
The PC ports will be access ports in their own VLANs.
interface range fa0/2 - 3switchport mode accessswitchport access vlan 10exitinterface range fa0/4 - 5switchport mode accessswitchport access vlan 20exitٹیسٹنگ: پہلے PC1 سے اپنا گیٹ وے پنگ کرو (192.168.10.1)۔
Testing: Pehle PC1 se apna gateway ping karo (192.168.10.1).
Testing: first ping your own gateway from PC1 (192.168.10.1).
پھر PC1 سے ping 192.168.20.10 — دوسرے VLAN تک جانا چاہیے۔ یہی inter-VLAN روٹنگ ہے۔
Phir PC1 se ping 192.168.20.10 — doosre VLAN tak jana chahiye. Yehi inter-VLAN routing hai.
Then from PC1, ping 192.168.20.10 — it should reach the other VLAN. That's inter-VLAN routing.
show ip interface brief سے sub-interfaces دیکھو۔ show vlans (یا show ip route) سے روٹنگ کنفرم کرو۔
show ip interface brief se sub-interfaces dekho. show vlans (ya show ip route) se routing confirm karo.
Check the sub-interfaces with show ip interface brief. Confirm routing with show vlans (or show ip route).
show ip interface briefshow ip route