Chapterبەش 2 · Lectureوانە 2.3

Inter-VLAN Routing with a Router: Router-on-a-Stickڕێدۆزیی نێوان VLANـەکان بە ڕێدۆز: ڕێدۆزی تاکقۆڵ

Why VLANs need a layer 3 device, the old one-interface-per-VLAN way, and router-on-a-stick: one 802.1Q trunk, one subinterface per VLAN with encapsulation dot1Q, the native VLAN on the router, PC gateways, the U-turn of every packet, verification, limits, designs with more switches and the address mistakes to avoid.

بۆچی ئامێرێکی چینی 3یان پێویستە، ڕێگا کۆنەکەی یەک بۆ هەر و : یەک ⁦802.1Q⁩، بۆ هەر یەک بە ⁦encapsulation dot1Q⁩، لەسەر ، PCـەکان، سووڕانەوەی هەموو ، پشکنین، سنوورەکان، نەخشەی چەند و ئەو هەڵانەی ناونیشان کە دەبێت لێیان دوور بکەویتەوە.

21 min read21 خولەک خوێندنەوە · 18 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Explain why inter-VLAN routing needs a layer 3 device and compare the legacy method with router-on-a-stick.
  • Configure subinterfaces with encapsulation dot1Q, including the native VLAN, and the switch trunk to the router.
  • Plan one subnet and one gateway address per VLAN and set the PCs’ gateways.
  • Trace a packet’s U-turn and verify with show ip interface brief, show ip route, show interfaces trunk and ping.
  • Recognise the limits of router-on-a-stick and the common configuration mistakes.
  • ڕوون بکەیتەوە بۆچی ئامێرێکی چینی 3ی پێویستە و ڕێگا کۆنەکە لەگەڵ بەراورد بکەیت.
  • بە ⁦encapsulation dot1Q⁩ ڕێک بخەیت (لەگەڵ ) و بەرەو .
  • بۆ هەر یەک و یەک ناونیشانی پلان بکەیت و PCـەکان دابنێیت.
  • سووڕانەوەی شوێن بکەویت و بە show ip interface brief، show ip route، show interfaces trunk و بیپشکنیت.
  • سنوورەکانی و هەڵە باوەکانی ڕێکخستن بناسیتەوە.

VLANs need a layer 3 device to talkVLANـەکان بۆ قسەکردن ئامێرێکی چینی 3یان پێویستە

VLANs keep groups apart: PCs in VLAN 10 and VLAN 20 cannot ping each other, even on the same switch (test the isolation). That is on purpose — each VLAN is its own broadcast domain and has its own subnet. To let them talk, under control, something must route packets from one subnet to the other. A switch that only switches frames cannot do it; you need a layer 3 device. This is inter-VLAN routing.

گرووپەکان لە یەک جیا دەهێڵنەوە: PCـەکانی ⁦VLAN 10⁩ و ⁦VLAN 20⁩ ناتوانن بۆ یەکتر بکەن، تەنانەت لەسەر هەمان (جیاکردنەوەکە تاقی بکەرەوە). ئەمە بە ئەنقەستە — هەر خۆیەتی و خۆی هەیە. بۆ ئەوەی قسە بکەن، بە کۆنترۆڵەوە، دەبێت شتێک لە بۆ ئەوی تر بکات. کە تەنیا دەگوازێتەوە ناتوانێت ئەمە بکات؛ ئامێرێکی چینی 3ت پێویستە. ئەمە .

Definitionپێناسە

Routing packets from one VLAN to another. Hosts in different VLANs are in different subnets and need a layer 3 device: a router with one interface per VLAN (the old way), router-on-a-stick, or a layer 3 switch with SVIs.

ڕێدۆزیی لە VLANـێکەوە بۆ VLANـێکی تر. میوانگرەکانی VLANـی جیاواز لە جیاوازدان و پێویستیان بە ئامێرێکی چینی 3 هەیە: بە یەک بۆ هەر VLANـێک (ڕێگا کۆنەکە)، ، یان بە SVI.

Switch SW1 with four PCs: PC1 192.168.10.11 and PC2 192.168.10.12 in VLAN 10 (green), PC3 192.168.20.11 and PC4 192.168.20.12 in VLAN 20 (orange). A dashed arc with a question mark joins the two groups. Text: a switch keeps VLANs apart; to join them you need routing, a layer 3 device.سویچی SW1 بە چوار PC: PC1 192.168.10.11 و PC2 192.168.10.12 لە VLAN 10 (سەوز)، PC3 192.168.20.11 و PC4 192.168.20.12 لە VLAN 20 (پرتەقاڵی). کەوانێکی خاڵخاڵ بە نیشانەی پرسیار دوو گرووپەکە پێکەوە دەبەستێت. دەق: سویچ VLANـەکان لە یەک جیا دەهێڵێتەوە؛ بۆ بەستنەوەیان ڕێدۆزی پێویستە، ئامێرێکی چینی 3.
Two VLANs, two subnets: a router must join them.دوو ، دوو : دەبێت پێکەوەیان ببەستێت.CêIT

There are three ways: one router interface per VLAN (the old way), router-on-a-stick (this lesson) and a layer 3 switch (next lesson). How a router chooses where to send a packet is in how packets are routed.

سێ ڕێگە هەیە: بۆ هەر (ڕێگا کۆنەکە)، (ئەم وانەیە) و (وانەی داهاتوو). چۆن بڕیار دەدات بۆ کوێ بنێرێت لە پاکێتەکان چۆن ڕێدۆزی دەکرێنـدایە.

The old way: one router interface per VLANڕێگا کۆنەکە: بۆ هەر VLANـێک نێوبەستەیەکی ڕێدۆز

The first solution was simple: give the router one physical interface per VLAN. G0/0 is cabled to an access port of VLAN 10 and gets 192.168.10.1; G0/1 is cabled to an access port of VLAN 20 and gets 192.168.20.1. Each interface is the default gateway of its VLAN. It works, but a router has only a few interfaces, and every new VLAN needs another interface, another cable and another switch port. Cisco’s CCNA course teaches it only to explain the idea; it is not used in switched networks today.

یەکەم چارەسەر ساکار بوو: بۆ هەر یەک فیزیکی بدە بە . ⁦G0/0⁩ بە ⁦VLAN 10⁩ دەبەسترێت و ⁦192.168.10.1⁩ وەردەگرێت؛ ⁦G0/1⁩ بە ⁦VLAN 20⁩ دەبەسترێت و ⁦192.168.20.1⁩ وەردەگرێت. هەر . کار دەکات، بەڵام تەنیا چەند هەیە و هەر نوێ ، کێبڵ و تری دەوێت. کۆرسی CCNAـی Cisco تەنیا بۆ ڕوونکردنەوەی بیرۆکەکە فێری دەکات؛ ئەمڕۆ لە سویچکراودا بەکار نایەت.

Router R1 above switch SW1, joined by two cables: G0/0 (green) to VLAN 10 and G0/1 (orange) to VLAN 20; PC1 in VLAN 10 and PC3 in VLAN 20 below. Text: G0/0 = 192.168.10.1, gateway of VLAN 10; G0/1 = 192.168.20.1, gateway of VLAN 20; the switch ports to the router are access ports; it works, but 10 VLANs need 10 router interfaces and 10 cables, and routers have only a few.ڕێدۆزی R1 لە سەرووی سویچی SW1، بە دوو کێبڵ بەستراون: G0/0 (سەوز) بۆ VLAN 10 و G0/1 (پرتەقاڵی) بۆ VLAN 20؛ PC1 لە VLAN 10 و PC3 لە VLAN 20 لە خوارەوە. دەق: G0/0 = 192.168.10.1، دەروازەی بنەڕەتیی VLAN 10؛ G0/1 = 192.168.20.1، دەروازەی بنەڕەتیی VLAN 20؛ دەرچەکانی سویچ بەرەو ڕێدۆز دەرچەی دەستڕاگەیشتنن؛ کار دەکات، بەڵام 10 VLAN پێویستیان بە 10 نێوبەستە و 10 کێبڵ دەبێت و ڕێدۆزەکان تەنیا چەند دانەیەکیان هەیە.
One interface and one cable per VLAN does not scale.بۆ هەر و کێبڵێک گەورە نابێت.CêIT

Router-on-a-stick: one trunk, many gatewaysڕێدۆزی تاکقۆڵ: یەک ترەنک، چەندین دەروازەی بنەڕەتی

A layer 3 switch is the fastest answer, but it costs more; a router you already have can do the job instead. Router-on-a-stick joins the router to the switch with one cable configured as an 802.1Q trunk (trunks). Inside the router, that one interface is split into one logical subinterface per VLAN, and each subinterface is the gateway of its VLAN. The router hangs on the switch by a single “stick” — hence the name.

خێراترین وەڵامە، بەڵام گرانترە؛ کە پێشتر هەتە دەتوانێت لە جیاتی ئەو کارەکە بکات. بە یەک کێبڵ بە دەبەستێت کە وەک ⁦802.1Q⁩ ڕێک خراوە (ترەنکەکان). لە ناو ، ئەو یەک بۆ هەر دابەش دەکرێت بە یەک لۆجیکی و هەر خۆیەتی. بە تاکە «قۆڵێک» بە هەڵدەواسرێت — بۆیە بە کوردی پێی دەڵێین .

Definitionپێناسە

Inter-VLAN routing through one router interface: the switch sends all VLANs to the router over one trunk, the router has one subinterface per VLAN (interface g0/0.10, encapsulation dot1Q 10) and sends each packet back down the same link.

بە یەک : هەموو VLANـەکان بە یەک دەنێرێت بۆ ؛ بۆ هەر VLANـێک هەیە (interface g0/0.10، encapsulation dot1Q 10) و هەر بە هەمان بەستەر دەگەڕێنێتەوە خوارەوە.

Router R1 on top joined by one thick trunk from G0/0 to SW1 G0/1. Labels at the router: G0/0.10 = 192.168.10.1 (green) and G0/0.20 = 192.168.20.1 (orange). Below SW1: PC1 Fa0/1 192.168.10.11 and PC2 Fa0/2 192.168.10.12 in VLAN 10; PC3 Fa0/6 192.168.20.11 and PC4 Fa0/7 192.168.20.12 in VLAN 20. Every VLAN reaches the router over the same cable.ڕێدۆزی R1 لە سەرەوە بە یەک ترەنکی ئەستوور لە G0/0ـەوە بۆ SW1 G0/1 بەستراوە. ناونیشانەکان لای ڕێدۆزەکە: G0/0.10 = 192.168.10.1 (سەوز) و G0/0.20 = 192.168.20.1 (پرتەقاڵی). لە ژێر SW1: PC1 Fa0/1 192.168.10.11 و PC2 Fa0/2 192.168.10.12 لە VLAN 10؛ PC3 Fa0/6 192.168.20.11 و PC4 Fa0/7 192.168.20.12 لە VLAN 20. هەموو VLANـێک بە هەمان کێبڵ دەگاتە ڕێدۆز.
One stick, one subinterface per VLAN.یەک قۆڵ، بۆ هەر .CêIT
The single hatch of a hospital officeتاکە پەنجەرەی نووسینگەی نەخۆشخانەیەک

A hospital’s records office has one hatch to the corridor. Files from every ward arrive at the hatch with a coloured label (the tag). The clerk reads the label and the destination, sticks on the label of the destination ward, and hands the file back out through the same hatch. One hatch serves every ward; the clerk is the router and the hatch is the trunk.

نووسینگەی تۆمارەکانی نەخۆشخانەیەک یەک پەنجەرەی هەیە بەرەو ڕاڕەوەکە. فایلی هەموو بەشێک بە نیشانەیەکی ڕەنگاوڕەنگەوە (تاگەکە) دەگاتە پەنجەرەکە. فەرمانبەرەکە نیشانەکە و شوێنی مەبەست دەخوێنێتەوە، نیشانەی بەشی مەبەست دەلکێنێت و فایلەکە بە هەمان پەنجەرەدا دەداتەوە دەرەوە. یەک پەنجەرە خزمەتی هەموو بەشەکان دەکات؛ فەرمانبەرەکە و پەنجەرەکە .

Where the analogy stops workingسنووری ئەم نموونەیە

If the hatch is busy, every ward waits — exactly the weakness of router-on-a-stick (see the limits below).

ئەگەر پەنجەرەکە قەرەباڵغ بێت، هەموو بەشەکان چاوەڕێ دەکەن — ڕێک لایەنی لاوازی (سنوورەکان لە خوارەوە ببینە).

Subinterfaces: one interface, many logical onesژێرنێوبەستەکان: یەک نێوبەستە، چەندین نێوبەستەی لۆجیکی

A subinterface is a logical interface made by dividing one physical interface into several virtual ones, each with its own settings. Its name is the physical name, a dot and a number: G0/0.10. Each subinterface gets its own VLAN tag (encapsulation dot1Q 10), its own IP address and mask, and other settings such as a description. The number after the dot is only a name; making it equal to the VLAN ID keeps the configuration easy to read.

لۆجیکییە کە بە دابەشکردنی یەک فیزیکی بۆ چەند دانەیەکی گریمانەیی دروست دەکرێت، هەریەکەیان بە خۆیەوە. ناوەکەی ناوی فیزیکییەکە، خاڵێک و ژمارەیەکە: G0/0.10. هەر خۆی (encapsulation dot1Q 10)، و خۆی و تری وەک وەسف وەردەگرێت. ژمارەی دوای خاڵەکە تەنیا ناوە؛ یەکسانکردنی لەگەڵ ژمارەی VLAN ڕێکخستنەکە ئاسان دەخوێنرێتەوە.

Definitionپێناسە

A logical interface made inside one physical router interface, such as g0/0.10, with its own VLAN tag and IP address; router-on-a-stick uses one subinterface per VLAN.

لۆجیکییە کە لەناو یەک نێوبەستەی فیزیکیی دروست دەکرێت، وەک ⁦g0/0.10⁩، بە و خۆیەوە؛ بۆ هەر VLANـێک یەک ژێرنێوبەستە بەکار دەهێنێت.

A large box GigabitEthernet0/0 — physical: no IP address, but no shutdown — holds four boxes: G0/0.10, encapsulation dot1Q 10, 192.168.10.1/24, gateway of VLAN 10 (green); G0/0.20, encapsulation dot1Q 20, 192.168.20.1/24, gateway of VLAN 20 (orange); G0/0.99, encapsulation dot1Q 99, 192.168.99.1/24, gateway of the management VLAN (blue); G0/0.999, dot1Q 999 native, no address, the unused native VLAN (grey). One cable, an 802.1Q trunk, goes down to SW1. Note: the number after the dot is a name; matching it to the VLAN ID keeps it clear.سندووقێکی گەورەی GigabitEthernet0/0 — فیزیکی: بێ ناونیشانی IP، بەڵام no shutdown — چوار سندووق هەڵدەگرێت: G0/0.10، encapsulation dot1Q 10، 192.168.10.1/24، دەروازەی بنەڕەتیی VLAN 10 (سەوز)؛ G0/0.20، encapsulation dot1Q 20، 192.168.20.1/24، دەروازەی بنەڕەتیی VLAN 20 (پرتەقاڵی)؛ G0/0.99، encapsulation dot1Q 99، 192.168.99.1/24، دەروازەی بنەڕەتیی VLANـی بەڕێوەبردن (شین)؛ G0/0.999، dot1Q 999 native، بێ ناونیشان، VLANـی ڕەسەنی بەکارنەهێنراو (خۆڵەمێشی). یەک کێبڵ، ترەنکی 802.1Q، دەچێتە خوارەوە بۆ SW1. تێبینی: ژمارەی دوای خاڵەکە ناوە؛ یەکسانکردنی لەگەڵ ژمارەی VLAN ڕوونی دەکاتەوە.
The physical interface carries the cable; the subinterfaces carry the addresses. کێبڵەکە هەڵدەگرێت؛ ناونیشانەکان هەڵدەگرن.CêIT

The lab and its address planتاقیکردنەوەکە و نەخشەی ناونیشانەکانی

Build this in Packet Tracer: a router R1 (a 1941 or 2911, interface G0/0) cabled to the G0/1 port of a 2960 switch, SW1. PCs on Fa0/1–5 are in VLAN 10, PCs on Fa0/6–10 in VLAN 20. VLAN 99 is the management VLAN for the switch’s own address. VLAN 999 is the native VLAN: unused, with no ports and no address, and kept apart from management, as Cisco’s hardening advice recommends. Each VLAN has one subnet and one gateway address, and that address lives on the router. An older 2811 router names the port FastEthernet0/0 — then type fa0/0 instead of g0/0.

ئەمە لە Packet Tracer دروست بکە: ⁦R1⁩، ⁦1941⁩ یان ⁦2911⁩، بە ⁦G0/0⁩ و بە ⁦G0/1⁩ـی ⁦2960⁩، ⁦SW1⁩ بەستراوە. PCـەکانی سەر ⁦Fa0/1–5⁩ لە ⁦VLAN 10⁩دان و PCـەکانی سەر ⁦Fa0/6–10⁩ لە ⁦VLAN 20. VLAN 99⁩ بەڕێوەبردنە بۆ ناونیشانی خودی . ⁦VLAN 999⁩ : بەکارنەهێنراوە، بێ و بێ ناونیشان. هەروەها لە بەڕێوەبردن جیا کراوەتەوە، وەک ئامۆژگاریی Cisco بۆ پاراستن. هەر یەک و یەک ناونیشانی هەیە و ئەو ناونیشانە لەسەر . کۆنتری ⁦2811⁩ ناوی ⁦FastEthernet0/0⁩ـە — ئەوکاتە لە جیاتی g0/0 بنووسە fa0/0.

The lab topology: R1 G0/0 joined by a trunk to SW1 G0/1; PC1 Fa0/1 192.168.10.11 and PC2 Fa0/2 192.168.10.12 in VLAN 10; PC3 Fa0/6 192.168.20.11 and PC4 Fa0/7 192.168.20.12 in VLAN 20. Address plan: VLAN 10, subnet 192.168.10.0/24, gateway 192.168.10.1, ports Fa0/1–5; VLAN 20, 192.168.20.0/24, gateway 192.168.20.1, ports Fa0/6–10; VLAN 99 (management), 192.168.99.0/24, gateway 192.168.99.1, SW1 192.168.99.2; VLAN 999, native, unused, no subnet.تۆپۆلۆجیی تاقیکردنەوەکە: R1 G0/0 بە ترەنک بە SW1 G0/1ـەوە بەستراوە؛ PC1 Fa0/1 192.168.10.11 و PC2 Fa0/2 192.168.10.12 لە VLAN 10؛ PC3 Fa0/6 192.168.20.11 و PC4 Fa0/7 192.168.20.12 لە VLAN 20. نەخشەی ناونیشان: VLAN 10، ژێرڕایەڵە 192.168.10.0/24، دەروازەی بنەڕەتی 192.168.10.1، دەرچەکان Fa0/1–5؛ VLAN 20، 192.168.20.0/24، دەروازەی بنەڕەتی 192.168.20.1، دەرچەکان Fa0/6–10؛ VLAN 99 (بەڕێوەبردن)، 192.168.99.0/24، دەروازەی بنەڕەتی 192.168.99.1، SW1 192.168.99.2؛ VLAN 999، ڕەسەن، بەکارنەهێنراو، بێ ژێرڕایەڵە.
One subnet and one gateway address per VLAN.بۆ هەر یەک و یەک ناونیشانی .CêIT

Step 1: the switch — VLANs, access ports and a trunk to the routerهەنگاوی 1: سویچەکە — VLAN، دەرچەکانی دەستڕاگەیشتن و ترەنکێک بۆ ڕێدۆز

On SW1 the VLANs and access ports are as in the VLAN lesson. The port to the router, G0/1, must be a trunk: the router has to receive every VLAN’s frames with their tags. A router does not speak DTP, so set the mode by hand with switchport mode trunk (a port left in dynamic auto would stay an access port) and turn DTP off with switchport nonegotiate. The switch’s own management address goes into VLAN 99, with R1 as its default gateway (the switch’s management address).

لەسەر ⁦SW1⁩ و وەک وانەی . بەرەو ، ⁦G0/1⁩، دەبێت بێت: دەبێت هەموو بە تاگەکانیانەوە وەربگرێت. بە قسە ناکات، بۆیە بارەکە بە دەست بە switchport mode trunk دابنێ ( کە لە dynamic auto بمێنێتەوە دەمێنێتەوە) و بە switchport nonegotiate DTP بکوژێنەوە. ناونیشانی بەڕێوەبردنی خودی دەچێتە ناو ⁦VLAN 99⁩، بە ⁦R1⁩ وەک (ناونیشانی بەڕێوەبردنی سویچ).

SW1 (2960)سویچی ⁦SW1 (2960)⁩TEXT
SW1(config)#vlan 10
SW1(config-vlan)#name IT
SW1(config-vlan)#vlan 20
SW1(config-vlan)#name Marketing
SW1(config-vlan)#vlan 99
SW1(config-vlan)#name Management
SW1(config-vlan)#vlan 999
SW1(config-vlan)#name Native
SW1(config-vlan)#exit
SW1(config)#interface range fastEthernet 0/1 - 5
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 10
SW1(config-if-range)#interface range fastEthernet 0/6 - 10
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 20
SW1(config-if-range)#exit
SW1(config)#interface gigabitEthernet 0/1
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport nonegotiate
SW1(config-if)#switchport trunk native vlan 999
SW1(config-if)#switchport trunk allowed vlan 10,20,99,999
SW1(config-if)#exit
SW1(config)#interface vlan 99
SW1(config-if)#ip address 192.168.99.2 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#ip default-gateway 192.168.99.1
SW1(config)#end
SW1#copy running-config startup-config
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 5-8

VLAN 99 for management; VLAN 999 is the native VLAN and stays empty.

⁦VLAN 99⁩ بۆ بەڕێوەبردن؛ ⁦VLAN 999⁩ و بەتاڵ دەمێنێتەوە.

Lineدێڕی 17-21

G0/1 to the router: a fixed trunk without DTP, native VLAN 999, only the VLANs in use.

⁦G0/1⁩ بەرەو : جێگیر بێ DTP، ⁦999⁩، تەنیا ئەو بەکار دێن.

Lineدێڕی 23-27

The management address of SW1 in VLAN 99; R1’s G0/0.99 is its gateway.

ناونیشانی بەڕێوەبردنی ⁦SW1⁩ لە ⁦VLAN 99⁩؛ ⁦G0/0.99⁩ـی ⁦R1⁩ .

Step 2: the router — no shutdown, then one subinterface per VLANهەنگاوی 2: ڕێدۆزەکە — no shutdown، پاشان بۆ هەر VLANـێک ژێرنێوبەستەیەک

First switch on the physical interface with no shutdown — router interfaces start administratively down, and every subinterface stays down while its parent is down. The physical interface needs no IP address. Then, for each VLAN, create the subinterface, give it its VLAN with encapsulation dot1Q, and then its gateway address. The order matters: IOS accepts an IP address on a LAN subinterface only after the encapsulation.

سەرەتا فیزیکی بە no shutdown هەڵبکە — بە administratively down دەست پێ دەکەن و هەموو تا دایکەکەی down بێت down دەمێنێتەوە. فیزیکی پێویستی بە نییە. پاشان بۆ هەر ، دروست بکە، بە encapsulation dot1Q بدەرێ و دواتر ناونیشانی . ڕیزبەندییەکە گرنگە: IOS تەنیا دوای encapsulation لەسەر LAN وەردەگرێت.

R1ڕێدۆزی ⁦R1⁩TEXT
R1>enable
R1#configure terminal
R1(config)#interface g0/0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#interface g0/0.10
R1(config-subif)#description Gateway of VLAN 10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 192.168.10.1 255.255.255.0
R1(config-subif)#exit
R1(config)#interface g0/0.20
R1(config-subif)#description Gateway of VLAN 20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 192.168.20.1 255.255.255.0
R1(config-subif)#exit
R1(config)#interface g0/0.99
R1(config-subif)#description Gateway of the management VLAN
R1(config-subif)#encapsulation dot1Q 99
R1(config-subif)#ip address 192.168.99.1 255.255.255.0
R1(config-subif)#exit
R1(config)#interface g0/0.999
R1(config-subif)#encapsulation dot1Q 999 native
R1(config-subif)#end
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 4-6

The parent interface comes up. Packet Tracer prints the same two lines again for each subinterface you create.

دایکەکە هەڵدەستێت. Packet Tracer بۆ هەر کە دروستی دەکەیت هەمان دوو دێڕ دووپاتە چاپ دەکات.

Lineدێڕی 8-11

Subinterface for VLAN 10: tag first, then the gateway address of VLAN 10.

بۆ ⁦VLAN 10⁩: سەرەتا تاگ، پاشان ناونیشانی ⁦VLAN 10⁩.

Lineدێڕی 18-21

The management VLAN 99 is tagged like any other VLAN; its subinterface is the gateway of SW1’s management address.

بەڕێوەبردنی ⁦99⁩ وەک هەر تر تاگ دەکرێت؛ ناونیشانی بەڕێوەبردنی ⁦SW1⁩ـە.

Lineدێڕی 23-24

The native VLAN 999: untagged frames would belong here. It gets no IP address, because nothing should live in it.

⁦999⁩: سەر بەم . هیچ وەرناگرێت، چونکە هیچ شتێک نابێت تێیدا بێت.

Common mistake: the IP address before the encapsulationهەڵەی باو: ناونیشانی IP پێش encapsulationTEXT
R1(config)#interface g0/0.30
R1(config-subif)#ip address 192.168.30.1 255.255.255.0
% Configuring IP routing on a LAN subinterface is only allowed if that subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q, or ISL vLAN.

IOS accepts unique abbreviations here too: int g0/0.10 and encap dot1q 10 work. A router already routes between its connected networks — ip routing is on by default on routers, so you do not need to type it (it is needed on layer 3 switches).

IOS لێرەشدا بێهاوتا وەردەگرێت: int g0/0.10 و encap dot1q 10 کار دەکەن. پێشتر لە نێوان ئەو پێیەوە بەستراون دەکات — ip routing لەسەر بە بنەڕەت هەڵکراوە، بۆیە پێویست ناکات بینووسیت (لەسەر پێویستە).

The native VLAN on the routerVLANـی ڕەسەن لەسەر ڕێدۆز

Frames of the native VLAN cross the trunk without a tag, so the router must know which subinterface owns untagged frames. encapsulation dot1Q 999 native marks subinterface G0/0.999 for that job. It must match the switch’s switchport trunk native vlan 999, and it needs no IP address, because nothing should live in VLAN 999. Older configurations often left the native VLAN at 1 and wrote encapsulation dot1Q 1 native; good practice uses an unused VLAN such as 999, apart from the management VLAN 99 (why).

بەبێ تاگ بە تێدەپەڕن، بۆیە دەبێت بزانێت کام خاوەنی . encapsulation dot1Q 999 native ⁦G0/0.999⁩ بۆ ئەو کارە نیشان دەکات. دەبێت لەگەڵ switchport trunk native vlan 999ـی یەک بگرێتەوە و پێویستی بە نییە، چونکە هیچ شتێک نابێت لە ⁦VLAN 999⁩دا بێت. لە ڕێکخستنە کۆنەکاندا زۆرجار لە 1دا دەمایەوە و encapsulation dot1Q 1 nativeـیان دەنووسی؛ ڕێگەی باش بەکارنەهێنراو بەکار دەهێنێت وەک ⁦999⁩، جیا لە بەڕێوەبردنی ⁦99⁩ (بۆچی).

Router R1 G0/0 with four subinterfaces: G0/0.10 dot1Q 10, G0/0.20 dot1Q 20, G0/0.99 dot1Q 99 (management) and G0/0.999 dot1Q 999 native. From SW1 below, four arrows go up the trunk: frames tagged 10, 20 and 99 to their subinterfaces, and an untagged frame to G0/0.999. Under SW1: switchport trunk native vlan 999. Both sides must agree: native VLAN 999 on the switch = dot1Q 999 native on the router; VLAN 999 stays empty.ڕێدۆزی R1 G0/0 بە چوار ژێرنێوبەستە: G0/0.10 dot1Q 10، G0/0.20 dot1Q 20، G0/0.99 dot1Q 99 (بەڕێوەبردن) و G0/0.999 dot1Q 999 native. لە SW1ـەوە لە خوارەوە چوار تیر بە ترەنکدا سەردەکەون: فرەیمەکان بە تاگی 10، 20 و 99 بۆ ژێرنێوبەستەکانی خۆیان و فرەیمێکی بێ‌تاگ بۆ G0/0.999. لە ژێر SW1: switchport trunk native vlan 999. هەردوو لا دەبێت ڕێک بن: VLANـی ڕەسەن 999 لەسەر سویچ = dot1Q 999 native لەسەر ڕێدۆز؛ VLAN 999 بەتاڵ دەمێنێتەوە.
Untagged frames go to the subinterface marked native. دەچنە ئەو بە native نیشان کراوە.CêIT

Step 3: the PCs — address, mask and gatewayهەنگاوی ⁦3: PC⁩ـەکان — ناونیشان، ماسکی ژێرڕایەڵە و دەروازەی بنەڕەتی

Every PC needs an address in its VLAN’s subnet, the mask 255.255.255.0 and, above all, a default gateway: the subinterface address of its own VLAN. PC1 and PC2 use 192.168.10.1, PC3 and PC4 use 192.168.20.1. Without a gateway a PC can reach only its own subnet (the default gateway). The VLANs themselves need no IP address on the switch; the PCs and the router’s subinterfaces do.

هەموو PCـێک ناونیشانێکی لە ، ⁦255.255.255.0⁩ و لە هەمووی گرنگتر پێویستە: ناونیشانی خۆی. ⁦PC1⁩ و ⁦PC2 192.168.10.1⁩ بەکار دەهێنن و ⁦PC3⁩ و ⁦PC4 192.168.20.1⁩. بەبێ PC تەنیا دەگاتە خۆی (دەروازەی بنەڕەتی). خودی لەسەر پێویستیان بە نییە؛ PCـەکان و پێویستیانە.

Three PC settings cards. PC1, VLAN 10 (tick): IP 192.168.10.11, mask 255.255.255.0, gateway 192.168.10.1. PC3, VLAN 20 (tick): 192.168.20.11, 255.255.255.0, 192.168.20.1. A common mistake (cross): 10.1.10.2, mask 255.0.0.0, gateway empty. Text: PC1 sends everything for other subnets to 192.168.10.1 (R1 G0/0.10); with mask 255.0.0.0 and no gateway the PC thinks every 10.x.x.x host is local; any address class works as long as each VLAN has its own subnet and gateway.سێ کارتی ڕێکخستنی PC. PC1، VLAN 10 (✓): IP 192.168.10.11، ماسکی ژێرڕایەڵە 255.255.255.0، دەروازەی بنەڕەتی 192.168.10.1. PC3، VLAN 20 (✓): 192.168.20.11، 255.255.255.0، 192.168.20.1. هەڵەیەکی باو (✗): 10.1.10.2، ماسکی ژێرڕایەڵەی 255.0.0.0، دەروازەی بنەڕەتی بەتاڵ. دەق: PC1 هەموو شتێک بۆ ژێرڕایەڵەکانی تر دەنێرێت بۆ 192.168.10.1 (R1 G0/0.10)؛ بە ماسکی ژێرڕایەڵەی 255.0.0.0 و بێ دەروازەی بنەڕەتی، PCـەکە وا دەزانێت هەموو میوانگرێکی 10.x.x.x ناوخۆییە؛ هەر پۆلێکی ناونیشان کار دەکات بە مەرجێک هەر VLANـێک ژێرڕایەڵە و دەروازەی بنەڕەتیی خۆی هەبێت.
Gateway = the subinterface of your own VLAN. = خۆت.CêIT

Follow one ping: the U-turn on the stickشوێن یەک پینگ بکەوە: سووڕانەوە لەسەر قۆڵەکە

PC1 (VLAN 10) pings PC3 (VLAN 20). PC1 sees that 192.168.20.11 is not in its subnet, so it sends the packet to its gateway. The frame goes up the trunk tagged 10, the router routes it from G0/0.10 to G0/0.20 and lowers the TTL by one, and the frame comes back down the same cable tagged 20. The switch removes the tag and delivers it to PC3. Every packet between two VLANs crosses the stick twice.

⁦PC1 (VLAN 10)⁩ بۆ ⁦PC3 (VLAN 20)⁩ دەکات. ⁦PC1⁩ دەبینێت ⁦192.168.20.11⁩ لە نییە، بۆیە دەنێرێت بۆ . بە تاگی ⁦10⁩ بە سەردەکەوێت، لە ⁦G0/0.10⁩ـەوە بۆ ⁦G0/0.20⁩ دەکات و یەکێک کەم دەکاتەوە و بە تاگی ⁦20⁩ بە هەمان کێبڵدا دەگەڕێتەوە خوارەوە. تاگەکە لادەبات و دەیگەیەنێتە ⁦PC3⁩. هەموو نێوان دوو دوو جار بە قۆڵەکەدا تێدەپەڕێت.

Animation in seven frames: R1 above SW1, PC1 (VLAN 10, green) and PC3 (VLAN 20, orange) below. 1: PC3 is in another subnet, so PC1 sends to its gateway 192.168.10.1. 2: an untagged frame enters SW1 on an access port of VLAN 10. 3: SW1 tags it 10 and sends it up the trunk to G0/0.10. 4: R1 looks up 192.168.20.11, connected on G0/0.20, and lowers the TTL by 1. 5: R1 sends it back down the same cable, tagged 20. 6: SW1 removes the tag and delivers the frame to PC3. 7: a green arrow up and an orange arrow down: the same cable carries it twice.
Animation in seven frames: R1 above SW1, PC1 (VLAN 10, green) and PC3 (VLAN 20, orange) below. 1: PC3 is in another subnet, so PC1 sends to its gateway 192.168.10.1. 2: an untagged frame enters SW1 on an access port of VLAN 10. 3: SW1 tags it 10 and sends it up the trunk to G0/0.10. 4: R1 looks up 192.168.20.11, connected on G0/0.20, and lowers the TTL by 1. 5: R1 sends it back down the same cable, tagged 20. 6: SW1 removes the tag and delivers the frame to PC3. 7: a green arrow up and an orange arrow down: the same cable carries it twice.
Up as VLAN 10, down as VLAN 20.وەک ⁦VLAN 10⁩ بۆ سەرەوە، وەک ⁦VLAN 20⁩ بۆ خوارەوە.CêIT

Step 4: verify on the router and the switchهەنگاوی 4: لەسەر ڕێدۆز و سویچ بیپشکنە

Three checks find almost every problem. On R1, show ip interface brief must show G0/0 and every subinterface up / up, and show ip route must show one connected route (C) and one local route (L) per VLAN. On SW1, show interfaces trunk must list G0/1 as trunking with native VLAN 999 and VLANs 10, 20, 99, 999.

سێ پشکنین نزیکەی هەموو کێشەیەک دەدۆزنەوە. لەسەر ⁦R1⁩، show ip interface brief دەبێت ⁦G0/0⁩ و هەموو بە ⁦up / up⁩ پیشان بدات و show ip route دەبێت بۆ هەر یەک ⁦(C)⁩ و یەک ڕێگەی ناوخۆیی ⁦(L)⁩ پیشان بدات. لەسەر ⁦SW1⁩، show interfaces trunk دەبێت ⁦G0/1⁩ وەک trunking بە ⁦999⁩ و VLANـەکانی ⁦10⁩، ⁦20⁩، ⁦99⁩، ⁦999⁩ ڕیز بکات.

R1: every subinterface up/up⁦R1⁩: هەموو ژێرنێوبەستەیەک ⁦up/up⁩TEXT
R1#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
GigabitEthernet0/0     unassigned      YES unset  up                    up
GigabitEthernet0/0.10  192.168.10.1    YES manual up                    up
GigabitEthernet0/0.20  192.168.20.1    YES manual up                    up
GigabitEthernet0/0.99  192.168.99.1    YES manual up                    up
GigabitEthernet0/0.999 unassigned      YES unset  up                    up
GigabitEthernet0/1     unassigned      YES unset  administratively down down
Vlan1                  unassigned      YES unset  administratively down down
R1: one C and one L route per subinterface (code list shortened)⁦R1⁩: بۆ هەر ژێرنێوبەستەیەک ڕێگەیەکی C و یەکی L (لیستی کۆدەکان کورت کراوەتەوە)TEXT
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

Gateway of last resort is not set

      192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.10.0/24 is directly connected, GigabitEthernet0/0.10
L        192.168.10.1/32 is directly connected, GigabitEthernet0/0.10
      192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.20.0/24 is directly connected, GigabitEthernet0/0.20
L        192.168.20.1/32 is directly connected, GigabitEthernet0/0.20
      192.168.99.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.99.0/24 is directly connected, GigabitEthernet0/0.99
L        192.168.99.1/32 is directly connected, GigabitEthernet0/0.99
One subinterface in detail (selected lines)یەک ژێرنێوبەستە بە وردی (چەند دێڕێکی هەڵبژێردراو)TEXT
R1#show interfaces g0/0.10
GigabitEthernet0/0.10 is up, line protocol is up
  Description: Gateway of VLAN 10
  Internet address is 192.168.10.1/24
  Encapsulation 802.1Q Virtual LAN, Vlan ID 10.
Three numbered check cards. 1, on R1: show ip interface brief — G0/0 and every G0/0.x up/up. 2, on R1: show ip route — one C route per VLAN subnet. 3, on SW1: show interfaces trunk — G0/1 trunking, native 999, VLANs 10, 20, 99, 999. Then ping from PC1 to PC3: a TTL of 127 in the reply shows one router on the way.سێ کارتی پشکنینی ژمارەدار. 1، لەسەر R1: show ip interface brief — G0/0 و هەموو G0/0.x up/up. 2، لەسەر R1: show ip route — بۆ هەر ژێرڕایەڵەیەکی VLAN ڕێگەیەکی C. 3، لەسەر SW1: show interfaces trunk — G0/1 trunking، ڕەسەن 999، VLANـەکانی 10، 20، 99، 999. پاشان لە PC1ـەوە پینگ بۆ PC3 بکە: TTL=127 لە وەڵامدا یەک ڕێدۆز لە ڕێگادا پیشان دەدات.
Three checks before you ping.سێ پشکنین پێش .CêIT

Step 5: ping between the VLANsهەنگاوی 5: پینگ لە نێوان VLANـەکاندا

Now PC1 reaches PC3. The first request may time out while ARP finds the gateway’s MAC address (why the first ping fails). The replies show TTL=127: the PC starts at 128 and the router took one off, so exactly one router was on the way. tracert 192.168.20.11 on PC1 shows two hops: 192.168.10.1 (the subinterface), then PC3. Finally save the router and the switch.

ئێستا ⁦PC1⁩ دەگاتە ⁦PC3⁩. لەوانەیە یەکەم کاتی بەسەر بچێت لە کاتێکدا دەدۆزێتەوە (بۆچی یەکەم پینگ سەرناکەوێت). وەڵامەکان ⁦TTL=127⁩ پیشان دەدەن: PC لە ⁦128⁩ـەوە دەست پێ دەکات و یەکێکی کەم کردەوە، بۆیە ڕێک یەک لە ڕێگادا بوو. tracert 192.168.20.11 لەسەر ⁦PC1⁩ دوو پیشان دەدات: ⁦192.168.10.1⁩ ()، پاشان ⁦PC3⁩. لە کۆتاییدا و پاشەکەوت بکە.

PC1 (VLAN 10) pings PC3 (VLAN 20)⁦PC1 (VLAN 10)⁩ پینگ بۆ ⁦PC3 (VLAN 20)⁩ دەکاتTEXT
C:\>ping 192.168.20.11

Pinging 192.168.20.11 with 32 bytes of data:

Request timed out.
Reply from 192.168.20.11: bytes=32 time<1ms TTL=127
Reply from 192.168.20.11: bytes=32 time<1ms TTL=127
Reply from 192.168.20.11: bytes=32 time<1ms TTL=127

Ping statistics for 192.168.20.11:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 5

The first request is lost while ARP runs.

یەکەم لە کاتی کارکردنی ARPـدا ون دەبێت.

Lineدێڕی 6-8

TTL=127: one router hop.

⁦TTL=127⁩: یەک .

The limits of one stickسنوورەکانی یەک قۆڵ

Router-on-a-stick is cheap and simple, but every routed frame crosses the one link twice, all VLANs share that link’s bandwidth, the router’s software routes each packet, and a single cable or port is a single point of failure. Cisco’s CCNA course calls it a good fit for small and medium networks and says it does not scale beyond about 50 VLANs. Bigger campuses route inside a layer 3 switch (layer 3 switching). In a real network the router usually hands out the PCs’ addresses too, with one DHCP pool per VLAN (DHCP pools per VLAN).

هەرزان و ساکارە، بەڵام هەموو ڕێدۆزراو دوو جار بەو یەک بەستەرەدا تێدەپەڕێت، هەموو ئەو بەستەرە بەش دەکەن، هەموو دەکات و تاکە کێبڵ یان . کۆرسی CCNAـی Cisco دەڵێت بۆ بچووک و مامناوەند گونجاوە و لە نزیکەی ⁦50⁩ زیاتر گەورە نابێت. کەمپەسە گەورەترەکان لە ناو دەکەن (سویچکردنی چینی 3). لە ڕاستەقینەدا زۆرجار ناونیشانی PCـەکانیش دەدات، بە بۆ هەر (DHCP بۆ هەر VLANـێک).

R1 above SW1 joined by one link with four coloured lines in it: every routed frame crosses this one link twice. Text: bandwidth — all inter-VLAN traffic shares one link (for example 1 Gb/s); router work — the router’s software routes every packet; one cable, one port — if it fails, no VLAN can reach another; fine for small and medium networks, Cisco’s course says it does not scale beyond about 50 VLANs. Box: bigger campus — a layer 3 switch routes in hardware, no stick needed.R1 لە سەرووی SW1 بە یەک بەستەر کە چوار هێڵی ڕەنگاوڕەنگی تێدایە: هەموو فرەیمێکی ڕێدۆزراو دوو جار بەم یەک بەستەرەدا تێدەپەڕێت. دەق: پانایی باند — هەموو هاتوچۆی نێوان VLANـەکان یەک بەستەر بەش دەکەن (بۆ نموونە 1 Gb/s)؛ کاری ڕێدۆز — نەرمەواڵەی ڕێدۆز هەموو پاکێتێک ڕێدۆزی دەکات؛ یەک کێبڵ، یەک دەرچە — ئەگەر تێک بچێت هیچ VLANـێک ناگاتە VLANـێکی تر؛ بۆ ڕایەڵەی بچووک و مامناوەند باشە، کۆرسی CCNAـی Cisco دەڵێت لە نزیکەی 50 VLAN زیاتر گەورە نابێت. سندووق: کەمپەسی گەورەتر — سویچی چینی 3 لە ڕەقەواڵەدا ڕێدۆزی دەکات، قۆڵی ناوێت.
Cheap and simple, but one link carries everything.هەرزان و ساکار، بەڵام یەک بەستەر هەموو شتێک هەڵدەگرێت.CêIT

More switches between the PCs and the routerسویچی زیاتر لە نێوان PCـەکان و ڕێدۆز

Real networks have several switches. Suppose R1 hangs on a middle switch SW1, and two leaf switches hang below it: SW2 with the PCs of VLAN 10 and SW3 with the PCs of VLAN 20. It is tempting to make each middle-switch port an access port “in the VLAN of the switch behind it”. Do not: that mixes trunk on one end and access on the other, works only by accident through the native VLAN, triggers native VLAN mismatch messages, and breaks as soon as a leaf switch has PCs of both VLANs. The clean design: every link between switches, and the link to the router, is a trunk on both ends; only PC ports are access ports. Every switch knows every VLAN.

ڕاستەقینە چەند هەیە. وای دابنێ ⁦R1⁩ بە ناوەندی ⁦SW1⁩ـەوە هەڵواسراوە و دوو لق لە ژێریدان: ⁦SW2⁩ بە PCـەکانی ⁦VLAN 10⁩ و ⁦SW3⁩ بە PCـەکانی ⁦VLAN 20⁩. وا دەردەکەوێت هەر ناوەندییەکە بکەیت بە «لە ئەو لە دواوەیەتی». مەیکە: ئەمە trunk لە سەرێک و access لە سەرەکەی تر تێکەڵ دەکات، تەنیا بە ڕێکەوت لە ڕێگەی کار دەکات، پەیامی نەگونجانی دروست دەکات و هەر کە لق PCـی هەردوو هەبوو تێک دەچێت. نەخشە پاکەکە: هەموو بەستەرێکی نێوان و بەستەرەکەی بەرەو لەسەر هەردوو سەر ؛ تەنیا PC . هەموو هەموو دەناسێت.

R1 on top, joined by a trunk to the middle switch SW1; SW1 joined by trunks to SW2 on the left and SW3 on the right; two VLAN 10 PCs under SW2 and two VLAN 20 PCs under SW3. Note: access ports only for PCs; trunk on both ends of every switch-to-switch and switch-to-router link.R1 لە سەرەوە، بە ترەنک بە سویچی ناوەندی SW1ـەوە بەستراوە؛ SW1 بە ترەنک بە SW2 لە چەپ و SW3 لە ڕاست بەستراوە؛ دوو PCـی VLAN 10 لە ژێر SW2 و دوو PCـی VLAN 20 لە ژێر SW3. تێبینی: دەرچەی دەستڕاگەیشتن تەنیا بۆ PC؛ ترەنک لەسەر هەردوو سەری هەموو بەستەرێکی سویچ بۆ سویچ و سویچ بۆ ڕێدۆز.
Trunks between all switches; access ports only for PCs. لە نێوان هەموو ؛ تەنیا بۆ PC.CêIT

One gateway address per VLANبۆ هەر VLANـێک یەک ناونیشانی دەروازەی بنەڕەتی

A gateway address belongs to one device. Look at this lab: the router’s subinterfaces have 10.1.10.1 and 10.1.20.1, and the switch was also given SVIs with exactly the same addresses. Two devices now claim one address — an IP conflict, and ARP answers from the wrong device. The PCs also had the mask 255.0.0.0 and no gateway. Remove the switch SVIs (the switch needs only a management address, in another VLAN), and give the PCs /24 masks and their gateways. The campus project has more planted mistakes to find (find the mistakes).

ناونیشانی هی یەک ئامێرە. سەیری ئەم تاقیکردنەوەیە بکە: ⁦10.1.10.1⁩ و ⁦10.1.20.1⁩یان هەیە و هەمان ناونیشانەکانیش وەک SVI دراون بە . ئێستا دوو ئامێر داوای یەک ناونیشان دەکەن — ناکۆکیی IP و وەڵامی لە ئامێری هەڵەوە. PCـەکانیش ⁦255.0.0.0⁩ و بێ بوون. SVIـەکانی لاببە ( تەنیا ناونیشانێکی بەڕێوەبردنی پێویستە، لە تردا) و ⁦255.255.255.0⁩ و خۆیان بدە بە PCـەکان. پڕۆژەی کەمپەس هەڵەی زیاتری تێدایە بۆ دۆزینەوە (هەڵەکان بدۆزەوە).

Common mistake: the switch copies the router’s gateway addressesهەڵەی باو: سویچ ناونیشانەکانی دەروازەی بنەڕەتیی ڕێدۆز کۆپی دەکاتTEXT
Switch(config)#interface vlan 10
Switch(config-if)#ip address 10.1.10.1 255.255.255.0
Switch(config-if)#exit
Switch(config)#interface vlan 20
Switch(config-if)#ip address 10.1.20.1 255.255.255.0
Two panels. Wrong: R1 G0/0.10 10.1.10.1 and SW1 Vlan10 10.1.10.1 — the same address twice; PCs with mask 255.0.0.0 and no default gateway work only by luck (ARP replies) and are then called “class A only”. Right: R1 G0/0.10 10.1.10.1/24 and G0/0.20 10.1.20.1/24 — the router owns the gateways; PCs /24 with gateway 10.1.10.1; SW1 needs no SVI; any class works, 10.1.x.x or 192.168.x.x alike. Note: IOS refuses a duplicate on one device; between two devices it causes an IP conflict.دوو بەش. هەڵە: R1 G0/0.10 10.1.10.1 و SW1 Vlan10 10.1.10.1 — هەمان ناونیشان دوو جار؛ PCـەکان بە ماسکی ژێرڕایەڵەی 255.0.0.0 و بێ دەروازەی بنەڕەتی تەنیا بە ڕێکەوت کار دەکەن (وەڵامی ARP) و پاشان پێی دەوترێت «تەنیا پۆلی A». ڕاست: R1 G0/0.10 10.1.10.1/24 و G0/0.20 10.1.20.1/24 — ناونیشانەکانی دەروازەی بنەڕەتی هی ڕێدۆزن؛ PCـەکان بە ماسکی ژێرڕایەڵەی 255.255.255.0 و دەروازەی بنەڕەتی 10.1.10.1؛ SW1 پێویستی بە SVI نییە؛ هەر پۆلێک کار دەکات، 10.1.x.x یان 192.168.x.x وەک یەک. تێبینی: IOS دووپاتە لەسەر یەک ئامێر ڕەت دەکاتەوە؛ لە نێوان دوو ئامێردا ناکۆکیی IP دروست دەکات.
The router owns the gateways; the switch only switches.ناونیشانەکانی هی ؛ تەنیا دەگوازێتەوە.CêIT

Common mistakesهەڵە باوەکان

A checklist of eight lines with ticks: the switch port to the router is a trunk, not access; the physical interface is on with no shutdown; encapsulation dot1Q N uses the right VLAN number; encapsulation before ip address on every subinterface; one subnet per VLAN and the gateway address only on the router; every PC has address, mask and its VLAN’s gateway; the native VLAN is the same on switch and router (dot1Q 999 native); save both devices with copy running-config startup-config.لیستی پشکنینی هەشت دێڕ بە ✓: دەرچەی سویچ بەرەو ڕێدۆز ترەنکە، نەک access؛ نێوبەستەی فیزیکی بە no shutdown هەڵکراوە؛ encapsulation dot1Q N ژمارەی VLANـی دروست بەکار دەهێنێت؛ encapsulation پێش ip address لەسەر هەموو ژێرنێوبەستەیەک؛ بۆ هەر VLANـێک یەک ژێرڕایەڵە و ناونیشانی دەروازەی بنەڕەتی تەنیا لەسەر ڕێدۆز؛ هەموو PCـێک ناونیشان، ماسکی ژێرڕایەڵە و دەروازەی بنەڕەتیی VLANـەکەی هەیە؛ VLANـی ڕەسەن لەسەر سویچ و ڕێدۆز وەک یەکە (dot1Q 999 native)؛ هەردوو ئامێر بە copy running-config startup-config پاشەکەوت بکە.
Eight checks for a working stick.هەشت پشکنین بۆ قۆڵێکی کارا.CêIT

Exercisesڕاهێنانەکان

ExerciseڕاهێنانComplete the router-on-a-stick labتاقیکردنەوەی ڕێدۆزی تاکقۆڵ تەواو بکە

A 2811 router’s Fa0/0 is cabled to Fa0/3 of a 2960 switch. PC0 on Fa0/1 is in VLAN 10, PC1 on Fa0/2 in VLAN 20. Write the switch and router configuration, and give each PC an address, mask and gateway (192.168.10.0/24 and 192.168.20.0/24). Do the VLANs themselves need IP addresses on the switch?

⁦2811 Fa0/0⁩ـی بە ⁦Fa0/3⁩ـی ⁦2960⁩ـەوە بەستراوە. ⁦PC0⁩ لەسەر ⁦Fa0/1⁩ لە ⁦VLAN 10⁩دایە و ⁦PC1⁩ لەسەر ⁦Fa0/2⁩ لە ⁦VLAN 20⁩. و بنووسە و ناونیشان، و بدە بە هەر PCـێک (⁦192.168.10.0/24⁩ و ⁦192.168.20.0/24⁩). ئایا خودی لەسەر پێویستە؟

Show answerوەڵامەکە پیشان بدە
AnswerوەڵامTEXT
Switch(config)#vlan 999
Switch(config-vlan)#name Native
Switch(config-vlan)#exit
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
% Access VLAN does not exist. Creating vlan 10
Switch(config-if)#interface fastEthernet 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
% Access VLAN does not exist. Creating vlan 20
Switch(config-if)#interface fastEthernet 0/3
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk native vlan 999
Switch(config-if)#end
Switch#copy running-config startup-config

Router(config)#interface fastEthernet 0/0
Router(config-if)#no shutdown
Router(config-if)#interface fastEthernet 0/0.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 192.168.10.1 255.255.255.0
Router(config-subif)#interface fastEthernet 0/0.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 192.168.20.1 255.255.255.0
Router(config-subif)#interface fastEthernet 0/0.999
Router(config-subif)#encapsulation dot1Q 999 native
Router(config-subif)#end
Router#copy running-config startup-config

PC0: 192.168.10.2, 255.255.255.0, gateway 192.168.10.1. PC1: 192.168.20.2, 255.255.255.0, gateway 192.168.20.1. The VLANs need no IP addresses on the switch (no interface vlan 10/20): the gateways live on the router. The PCs, however, do need addresses and gateways. VLAN 999 is the unused native VLAN on both sides, as in the lab; VLANs 10 and 20 are created automatically when the ports are assigned.

⁦PC0: 192.168.10.2⁩، ⁦255.255.255.0⁩، ⁦192.168.10.1. PC1: 192.168.20.2⁩، ⁦255.255.255.0⁩، ⁦192.168.20.1⁩. لەسەر پێویست نییە (interface vlan 10/20 نا): ناونیشانەکانی لەسەر . بەڵام PCـەکان ناونیشان و پێویستە. ⁦VLAN 999⁩ لە هەردوو لا بەکارنەهێنراوە، وەک لە تاقیکردنەوەکەدا؛ ⁦VLAN 10⁩ و ⁦20⁩ کاتی دانانی خۆکار دروست دەبن.

ExerciseڕاهێنانRepair a lab that “only works with class A”تاقیکردنەوەیەک چاک بکەرەوە کە «تەنیا بە پۆلی A کار دەکات»

In a lab, R1 Fa0/0.10 = 10.1.10.1/24 and Fa0/0.20 = 10.1.20.1/24; the switch has interface vlan 10 = 10.1.10.1 and interface vlan 20 = 10.1.20.1; the PCs use 10.1.10.2 and 10.1.20.2 with mask 255.0.0.0 and no gateway; the lab claims that a gateway is not needed and that 192.168.x.x would not work. Find the three mistakes and write the correct plan.

لە تاقیکردنەوەیەکدا ⁦R1 Fa0/0.10 = 10.1.10.1/24⁩ و ⁦Fa0/0.20 = 10.1.20.1/24⁩ـە؛ interface vlan 10 = ⁦10.1.10.1⁩ و interface vlan 20 = ⁦10.1.20.1⁩ـی هەیە؛ PCـەکان ⁦10.1.10.2⁩ و ⁦10.1.20.2⁩ بە ⁦255.0.0.0⁩ و بێ بەکار دەهێنن؛ تاقیکردنەوەکە دەڵێت پێویست نییە و ⁦192.168.x.x⁩ کار ناکات. سێ هەڵەکە بدۆزەوە و نەخشەی دروست بنووسە.

Show answerوەڵامەکە پیشان بدە
  • Duplicate addresses: the switch SVIs copy the router’s gateways. Remove them (no interface vlan 10, no interface vlan 20).
  • Wrong mask and no gateway: with 255.0.0.0 every 10.x.x.x address looks local, so the PCs never use the router; it only seems to work through ARP replies from the router. Use 255.255.255.0 and gateways 10.1.10.1 and 10.1.20.1.
  • “Class A only” is a wrong diagnosis: the same lab with 192.168.10.0/24 and 192.168.20.0/24 and correct gateways works too.
  • ناونیشانی دووپاتە: SVIـەکانی ناونیشانەکانی کۆپی دەکەن. لایان ببە (no interface vlan 10، no interface vlan 20).
  • هەڵە و بێ : بە ⁦255.0.0.0⁩ هەموو ناونیشانێکی ⁦10.x.x.x⁩ ناوخۆیی دەردەکەوێت، بۆیە PCـەکان هەرگیز بەکار ناهێنن؛ تەنیا لە ڕێگەی وەڵامی ARPـی وا دەردەکەوێت کار بکات. ⁦255.255.255.0⁩ و ناونیشانەکانی ⁦10.1.10.1⁩ و ⁦10.1.20.1⁩ بەکار بهێنە.
  • «تەنیا پۆلی A» دەستنیشانکردنێکی هەڵەیە: هەمان تاقیکردنەوە بە ⁦192.168.10.0/24⁩ و ⁦192.168.20.0/24⁩ و دروست کار دەکات.
ExerciseڕاهێنانFinish the half-typed commandفەرمان نیوەنووسراوەکە تەواو بکە

A screenshot shows only: Router(config)#int fa0/0.10, then Router(config-subif)#en and encap…, cut at the edge. Write the full three-line sequence for VLAN 10 with the gateway 192.168.3.1/24, and say which prompt each line has.

تەنیا ئەمە پیشان دەدات: Router(config)#int fa0/0.10، پاشان Router(config-subif)#en و encap…، لە لێوارەکەدا بڕاوە. هەر سێ دێڕەکە بۆ ⁦VLAN 10⁩ بە ⁦192.168.3.1/24⁩ تەواو بنووسە و بڵێ هەر دێڕێک چ پرۆمپتێکی هەیە.

Show answerوەڵامەکە پیشان بدە
AnswerوەڵامTEXT
Router(config)#interface fastEthernet 0/0.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 192.168.3.1 255.255.255.0

After interface fa0/0.10 the prompt is Router(config-subif)#. encap dot1q 10 is an accepted abbreviation; a word cut too short is not — type enough letters for IOS to know the command.

دوای interface fa0/0.10 پرۆمپتەکە Router(config-subif)#ـە. encap dot1q 10 وەرگیراوە؛ وشەیەک کە زۆر کورت بڕابێت نا — ئەوەندە پیت بنووسە کە IOS بناسێتەوە.

ExerciseڕاهێنانRouter-on-a-stick behind a WAN linkڕێدۆزی تاکقۆڵ لە پشت بەستەرێکی WAN

Two routers are joined by a serial link (192.168.2.0/24). The left router has one LAN, 192.168.1.0/24. The right router reaches a 2960 switch on Fa0/24, where PC3 on Fa0/1 is in VLAN 10 (192.168.3.0/24) and PC4 on Fa0/6 in VLAN 20 (192.168.4.0/24). Which parts of this lesson do you use on the right router and its switch, and what else is needed so that the left LAN can reach PC3?

دوو بە بەستەرێکی سیریاڵ بەستراون ⁦(192.168.2.0/24)⁩. چەپ یەک هەیە، ⁦192.168.1.0/24⁩. ڕاست دەگاتە ⁦2960⁩ لەسەر ⁦Fa0/24⁩، کە ⁦PC3⁩ لەسەر ⁦Fa0/1⁩ لە ⁦VLAN 10 (192.168.3.0/24)⁩ و ⁦PC4⁩ لەسەر ⁦Fa0/6⁩ لە ⁦VLAN 20 (192.168.4.0/24)⁩دان. کام بەشەکانی ئەم وانەیە لەسەر ڕاست و بەکار دەهێنیت و چی تر پێویستە تاکو لای چەپ بگاتە ⁦PC3⁩؟

Show answerوەڵامەکە پیشان بدە

On the right: Fa0/24 of the switch is a trunk with the unused native VLAN 999, the right router gets no shutdown on its LAN interface and subinterfaces Fa0/0.10 (192.168.3.1) and Fa0/0.20 (192.168.4.1) with encapsulation dot1Q (and Fa0/0.999 with encapsulation dot1Q 999 native); PC3 and PC4 use those gateways. The routers then need routes to each other’s networks — static routes or a routing protocol (static routes; a RIP lab with VLANs behind a router is in RIP lab 2), with the serial link configured as in your first router.

لە لای ڕاست: ⁦Fa0/24⁩ـی بە بەکارنەهێنراوی ⁦999⁩، ڕاست no shutdown لەسەر LANـەکەی و ⁦Fa0/0.10 (192.168.3.1)⁩ و ⁦Fa0/0.20 (192.168.4.1)⁩ بە encapsulation dot1Q وەردەگرێت (و ⁦Fa0/0.999⁩ بە encapsulation dot1Q 999 native)؛ ⁦PC3⁩ و ⁦PC4⁩ ئەو ناونیشانانە وەک بەکار دەهێنن. پاشان ڕێگەیان بۆ یەکتر پێویستە — یان (ڕێگە جێگیرەکان؛ تاقیکردنەوەیەکی RIP بە لە پشت لە تاقیکردنەوەی 2ـی RIP هەیە). بەستەرە سیریاڵەکەش وەک یەکەم ڕێدۆزت ڕێک دەخرێت.

ExerciseڕاهێنانWhy subinterfaces?بۆچی ژێرنێوبەستە؟

In your own words: what is a subinterface, when is it used, and what does each one have of its own?

بە وشەی خۆت: چییە، کەی بەکار دێت و هەریەکەیان چی هی خۆی هەیە؟

Show answerوەڵامەکە پیشان بدە

A subinterface is a logical interface made by dividing one physical interface, such as G0/0.10. It is used when several networks must share one physical interface — for example a router serving several VLANs over one trunk (router-on-a-stick). Each has its own number, VLAN tag (encapsulation dot1Q), IP address and mask, and description.

لۆجیکییە کە بە دابەشکردنی یەک فیزیکی دروست دەکرێت، وەک ⁦G0/0.10⁩. بەکار دێت کاتێک چەند دەبێت یەک فیزیکی بەش بکەن — بۆ نموونە کە بە یەک خزمەتی چەند دەکات (). هەریەکەیان ژمارە، (encapsulation dot1Q)، و و وەسفی خۆی هەیە.

ExerciseڕاهێنانDesign: a middle switchنەخشە: سویچێکی ناوەندی

R1 is cabled to SW1 Fa0/3. SW1 Fa0/1 goes to SW0 (PCs of VLAN 10) and SW1 Fa0/2 to SW3 (PCs of VLAN 20). Which ports are trunks and which are access ports? Where do the gateways live, and which switches need which VLANs?

⁦R1⁩ بە ⁦SW1 Fa0/3⁩ـەوە بەستراوە. ⁦SW1 Fa0/1⁩ دەچێت بۆ ⁦SW0⁩، کە PCـەکانی ⁦VLAN 10⁩ـی لەسەرە. ⁦SW1 Fa0/2⁩ دەچێت بۆ ⁦SW3⁩، کە PCـەکانی ⁦VLAN 20⁩ـی لەسەرە. کام و کامیان ؟ ناونیشانەکانی لە کوێن و کام کام پێویستە؟

Show answerوەڵامەکە پیشان بدە
  • Trunks: SW1 Fa0/3 (to R1), SW1 Fa0/1 and Fa0/2, and the uplinks of SW0 and SW3 — both ends of every inter-switch link.
  • Access ports: only the PC ports on SW0 (VLAN 10) and SW3 (VLAN 20).
  • Gateways: R1’s subinterfaces G0/0.10 = 192.168.10.1 and G0/0.20 = 192.168.20.1; the switches need no SVIs for these VLANs.
  • Create VLAN 10 and VLAN 20 on every switch, so each can carry both VLANs and new PCs can be added anywhere. Every trunk uses the unused native VLAN 999, as in the lab.
  • : ⁦SW1 Fa0/3⁩ (بەرەو ⁦R1⁩)، ⁦SW1 Fa0/1⁩ و ⁦Fa0/2⁩ و سەرەوەی ⁦SW0⁩ و ⁦SW3⁩ — هەردوو سەری هەموو بەستەرێکی نێوان .
  • : تەنیا PC لەسەر ⁦SW0 (VLAN 10)⁩ و ⁦SW3 (VLAN 20)⁩.
  • ناونیشانەکانی : ⁦R1⁩، ⁦G0/0.10 = 192.168.10.1⁩ و ⁦G0/0.20 = 192.168.20.1⁩؛ بۆ ئەم SVIـیان ناوێت.
  • ⁦VLAN 10⁩ و ⁦VLAN 20⁩ لەسەر هەموو دروست بکە، تاکو هەریەکەیان هەردوو هەڵبگرێت و PCـی نوێ لە هەر شوێنێک زیاد بکرێت. هەموو بەکارنەهێنراوی ⁦999⁩ بەکار دەهێنێت، وەک لە تاقیکردنەوەکەدا.

Summaryکورتە

  • Different VLANs are different subnets: a layer 3 device must route between them — inter-VLAN routing.
  • The old way used one router interface and cable per VLAN; router-on-a-stick uses one 802.1Q trunk and one subinterface per VLAN.
  • Router: no shutdown on G0/0, then interface g0/0.10, encapsulation dot1Q 10, ip address … — encapsulation first; encapsulation dot1Q 999 native for the unused native VLAN.
  • Switch: the port to the router is a fixed trunk; PC ports are access ports; no SVIs with the gateway addresses.
  • PCs: address in their VLAN’s subnet, the right mask and the subinterface as gateway; any address class works.
  • Verify with show ip interface brief, show ip route, show interfaces trunk and ping (TTL 127). Limits: one shared link, router software, single point of failure — fine for small networks.
  • جیاواز جیاوازن: ئامێرێکی چینی 3 دەبێت لە نێوانیاندا بکات — .
  • ڕێگا کۆنەکە بۆ هەر و کێبڵێکی بەکار دەهێنا؛ یەک ⁦802.1Q⁩ و بۆ هەر یەک بەکار دەهێنێت.
  • : no shutdown لەسەر ⁦G0/0⁩، پاشان interface g0/0.10، encapsulation dot1Q 10، ip address … — سەرەتا encapsulation؛ encapsulation dot1Q 999 native بۆ بەکارنەهێنراو.
  • : بەرەو جێگیرە؛ PC ؛ هیچ SVIـێک بە ناونیشانەکانی .
  • PCـەکان: ناونیشان لە ، دروست و وەک ؛ هەر پۆلێکی ناونیشان کار دەکات.
  • بە show ip interface brief، show ip route، show interfaces trunk و ⁦(TTL 127)⁩ بیپشکنە. سنوورەکان: یەک بەستەری هاوبەش، ، — بۆ بچووک باشە.

Next: route inside the switch itself — Inter-VLAN routing with a layer 3 switch.

دواتر: لە ناو خودی بکە — ڕێدۆزیی نێوان VLANـەکان بە سویچی چینی 3.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

Inter-VLAN Routing with a Layer-3 Switchڕێدۆزیی نێوان VLANـەکان بە سویچی چینی 3

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.

Appearanceڕووکار

Modeدۆخ
Styleشێواز
Coloursڕەنگەکان

Saved on this device only.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.