VLAN and Inter-VLAN Routing Configuration

Toriq Ziadi Rachman
9 min readSep 4, 2021

--

Di lab ini Anda akan melakukan konfigurasi VLAN untuk jaringan kampus, termasuk protokol Trunking Virtual, port Access dan Trunk, dan routing antar-VLAN.

Lab Topology

VTP, Access and Trunk Ports

1) All routers and switches are in a factory default state. View the VLAN database on SW1 to verify no VLANs have been added.

SW1#show vlan brief

VLAN Name Status Ports

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -

1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4

Fa0/5, Fa0/6, Fa0/7, Fa0/8

Fa0/9, Fa0/10, Fa0/11, Fa0/12

Fa0/13, Fa0/14, Fa0/15, Fa0/16

Fa0/17, Fa0/18, Fa0/19, Fa0/20

Fa0/21, Fa0/22, Fa0/23, Fa0/24

Gig0/1, Gig0/2

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

2) View the default switchport status on the link from SW1 to SW2.

SW1#show vlan brief

VLAN Name Status Ports

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -

1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4

Fa0/5, Fa0/6, Fa0/7, Fa0/8

Fa0/9, Fa0/10, Fa0/11, Fa0/12

Fa0/13, Fa0/14, Fa0/15, Fa0/16

Fa0/17, Fa0/18, Fa0/19, Fa0/20

Fa0/21, Fa0/22, Fa0/23, Fa0/24

Gig0/1, Gig0/2

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

3) Configure the links between switches as trunks.

SW1(config)#int g0/1

SW1(config-if)#switchport mode trunk

SW2(config)#int g0/1

SW2(config-if)#switchport trunk encapsulation dot1q

SW2(config-if)#switchport mode trunk

SW2(config-if)#int g0/2

SW2(config-if)#switchport mode trunk

SW2(config-if)#switchport trunk encapsulation dot1q

SW3(config)#int g0/2

SW3(config-if)#switchport mode trunk

Notes:

Switchport memiliki 2 mode, mode access dan mode trunk. Mode Access hanya dapat mengantarkan dilewati dengan 1 VLAN saja dan harus ditentukan VLAN berapa. Sedangkan Mode Trunk dapat dilewati dengan beberapa VLAN.

SW1 dan SW3 adalah Switch Layer 2 seperti pada umumnya. Sedangkan SW2 adalah Switch Layer 3 atau Multi Layer Switching (MLS) yang dapat melakukan switching serta routing. Defaultnya, interface pada Switch Layer 3 adalah switch virtual interfaces (SVI) atau routed interfaces. Agar interface dapat berfungsi menjadi mode trunk, maka perlu ditambahkan command switchport trunk encapsulation dot1q seperti layaknya router.

4) Configure SW1 as a VTP Server in the VTP domain Flackbox.

SW1(config)#vtp domain Flackbox

Changing VTP domain name from NULL to Flackbox

SW1(config)#vtp mode server

Device mode already VTP SERVER.

Notes:

VLAN Trunking Protocol (VTP) berfungsi untuk menyebarkan informasi tentang VLAN kepada setiap switch. VTP pada switch ada 3 mode. Mode server, client, transparent. Mode server sebagai pusat informasi VLAN. Mode Client sebagai penerima informasi VLAN dari VTP server. Sedangkan mode transparent sebagai pengantar informasi VLAN tanpa menyimpan informasi VLAN.

Perlu diingat bahwa VTP memiliki domain. VTP dapat berfungsi untuk saling mengirimkan informasi VLAN hanya kepada sesama domain-nya saja.

Di sini SW1 difungsikan sebagai VTP server dengan domain Flackbox.

5) SW2 must not synchronise its VLAN database with SW1.

SW2(config)#vtp mode transparent

Setting device to VTP TRANSPARENT mode.

Notes:

Di sini SW2 difungsikan sebagai VTP transparent, maka SW2 hanya mengantarkan informasinya saja tanpa menyimpannya sebagai konfigurasi VLAN.

6) SW3 must learn VLAN information from SW1. VLANs should not be edited on SW3.

SW3(config)#vtp mode client

Setting device to VTP CLIENT mode.

SW3(config)#vtp domain Flackbox

Changing VTP domain name from NULL to Flackbox

Notes:

Di sini SW3 difungsikan sebagai VTP client, disertai dengan domain Flackbox. Seharusnya SW3 dapat menerima informasi dari VTP Server yaitu SW1 dan digunakannya sebagai konfigurasi VLAN.

7) Add the Eng, Sales and Native VLANs on all switches.

SW1(config)#vlan 10

SW1(config-vlan)#name Eng

SW1(config-vlan)#exit

SW1(config)#vlan 20

SW1(config-vlan)#name Sales

SW1(config-vlan)#exit

SW1(config)#vlan 199

SW1(config-vlan)#name Native

SW2(config)#vlan 10

SW2(config-vlan)#name Eng

SW2(config-vlan)#exit

SW2(config)#vlan 20

SW2(config-vlan)#name Sales

SW2(config-vlan)#exit

SW2(config)#vlan 199

SW2(config-vlan)#name Native

SW2(config-vlan)#exit

Notes:

Di soal ini, kita diminta untuk mengkonfigurasi VLAN pada seluruh switch yaitu SW1, SW2, dan SW3. Namun disini cukup hanya SW1 dan SW2 saja. Karena, apabila kita konfigurasi VLAN di SW1, maka SW3 otomatis mengikuti.

8) Verify the VLANs are in the database on each switch.

SW1#show vlan brief

VLAN Name Status Ports

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -

1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4

Fa0/5, Fa0/6, Fa0/7, Fa0/8

Fa0/9, Fa0/10, Fa0/11, Fa0/12

Fa0/13, Fa0/14, Fa0/15, Fa0/16

Fa0/17, Fa0/18, Fa0/19, Fa0/20

Fa0/21, Fa0/22, Fa0/23, Fa0/24

Gig0/2

10 Eng active

20 Sales active

199 Native active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

SW2#show vlan brief

VLAN Name Status Ports

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -

1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4

Fa0/5, Fa0/6, Fa0/7, Fa0/8

Fa0/9, Fa0/10, Fa0/11, Fa0/12

Fa0/13, Fa0/14, Fa0/15, Fa0/16

Fa0/17, Fa0/18, Fa0/19, Fa0/20

Fa0/21, Fa0/22, Fa0/23, Fa0/24

10 Eng active

20 Sales active

199 Native active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

SW3#show vlan brief

VLAN Name Status Ports

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -

1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4

Fa0/5, Fa0/6, Fa0/7, Fa0/8

Fa0/9, Fa0/10, Fa0/11, Fa0/12

Fa0/13, Fa0/14, Fa0/15, Fa0/16

Fa0/17, Fa0/18, Fa0/19, Fa0/20

Fa0/21, Fa0/22, Fa0/23, Fa0/24

Gig0/1

10 Eng active

20 Sales active

199 Native active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

Notes:

SW1, SW2 dan SW3 terverifikasi dengan VLAN yang sudah dikonfigurasi sebelumnya dimana sudah ditambahkan VLAN 10 Eng, VLAN 20 Sales dan VLAN 199 Native.

9) Configure the trunk links to use VLAN 199 as the native VLAN for better security.

SW1(config)#int g0/1

SW1(config-if)#switchport trunk native vlan 199

SW2(config)#int g0/1

SW2(config-if)#switchport trunk native vlan 199

SW2(config-if)#int g0/2

SW2(config-if)#switchport trunk native vlan 199

SW3(config)#int g0/2

SW3(config-if)#switchport trunk native vlan 199

Notes:

Sebelumnya Native VLAN adalah VLAN 1. Karena VLAN 1 adalah default dan dapat dijangkau secara mudah. Maka agar lebih aman, Trunk tersebut dibuat native VLAN 199.

10) Configure the switchports connected to the PCs with the correct VLAN configuration.

SW1(config)#int range f0/1–2

SW1(config-if-range)#switchport mode access

SW1(config-if-range)#switchport access vlan 10

SW1(config-if-range)#exit

SW1(config)#int f0/3

SW1(config-if)#switchport mode access

SW1(config-if)#switchport access vlan 20

SW3(config)#int range f0/1–2

SW3(config-if-range)#switchport mode access

SW3(config-if-range)#switchport access vlan 20

SW3(config-if-range)#exit

SW3(config)#int f0/3

SW3(config-if)#switchport mode access

SW3(config-if)#switchport access vlan 10

Notes:

Untuk interface yang terhubung dengan PC Engineer, dikonfigurasikan mode Access dengan VLAN 10. Untuk interface yang terhubung dengan PC Sales, dikonfigurasikan mode Access dengan VLAN 20.

11) Verify the Eng1 PC has connectivity to Eng3.

12) Verify Sales1 has connectivity to Sales3.

Notes:

PC Eng1 sudah dapat mengakses PC Eng3 melalui switch SW1, SW2, SW3 yang sudah dikonfigurasi Trunk. PC Sales1 sudah dapat mengakses PC Sales3 melalui switch SW3, SW2, SW1 yang sudah dikonfigurasi Trunk. Maka, dapat disimpulkan bahwa fungsi Trunk di ketiga Switch tersebut sudah berfungsi dengan baik.

Inter-VLAN Routing — Option 1 Separate Interfaces on Router

13) Configure interface FastEthernet0/0 on R1 as the default gateway for the Eng PCs.

R1(config)#int f0/0

R1(config-if)#ip add 10.10.10.1 255.255.255.0

R1(config-if)#no shutdown

Notes:

IP address 10.10.10.1 dibuat menjadi gateway di interface f0/0 R1 untuk PC Eng.

14) Configure interface FastEthernet0/1 on R1 as the default gateway for the Sales PCs.

R1(config)#int f0/1

R1(config-if)#ip add 10.10.20.1 255.255.255.0

R1(config-if)#no shutdown

Notes:

IP address 10.10.20.1 dibuat menjadi gateway di interface f0/1 R1 untuk PC Sales.

15) Configure SW2 to support inter-VLAN routing using R1 as the default gateway.

SW2(config)#int f0/1

SW2(config-if)#switchport mode access

SW2(config-if)#switchport access vlan 10

SW2(config-if)#exit

SW2(config)#int f0/2

SW2(config-if)#switchport mode access

SW2(config-if)#switchport access vlan 20

Notes:

Interface pada R1 f0/1 dibuat menjadi mode access dengan vlan 10. Kemudian Interface f0/2 dibuat menjadi mode access dengan vlan 20.

16) Verify the Eng1 PC has connectivity to the VLAN 20 interface on R1.

Notes:

PC Eng1 sudah dapat terkoneksi dengan VLAN 20 di interface R1, itu artinya VLAN 10 sudah dapat mengakses VLAN 20 ataupun sebaliknya.

17) Verify the Eng1 PC has connectivity to Sales1.

Notes:

PC Eng1 sudah dapat terkoneksi dengan PC Sales1, itu artinya PC VLAN 10 sudah dapat saling bertukar informasi dengan PC VLAN 20 ataupun sebaliknya.

18) Clean-up: Shut down interface FastEthernet0/1 on R1.

R1(config-if)#int f0/1

R1(config-if)#shutdown

Inter-VLAN Routing — Option 2 Router on a Stick

19) Configure sub-interfaces on FastEthernet0/0 on R1 as the default gateway for the Eng and Sales PCs.

R1(config)#int f0/0

R1(config-if)#no ip address

R1(config)#int f0/0.10

R1(config-subif)#encapsulation dot1Q 10

R1(config-subif)#ip add 10.10.10.1 255.255.255.0

R1(config)#int f0/0.20

R1(config-subif)#encapsulation dot1Q 20

R1(config-subif)#ip add 10.10.20.1 255.255.255.0

Notes:

R1 saat ini hanya menghidupkan 1 interface saja yaitu f0/0. 1 Interface pada Router secara logical dapat digunakan untuk dilewati lebih dari 1 VLAN.

R1 physical interface f0/0 ditambahkan 2 logical interface untuk 2 VLAN. Yaitu f0/0.10 untuk VLAN 10, dan f0/0.20 untuk VLAN 20. Tidak lupa juga untuk menambahkan command encapsulation dot1q 10 dan 20 untuk masing-masing logical interface tersebut yang fungsinya untuk trunking. Kemudian tambahkan juga masing-masing logical interface dengan IP address sesuai dengan masing-masing vlan. IP address 10.10.10.1 untuk VLAN 10, dan IP address 10.10.20.1 untuk VLAN 20.

20) Configure SW2 to support inter-VLAN routing using R1 as the default gateway.

SW2(config)#int f0/1

SW2(config-if)#switchport mode trunk

SW2(config-if)#switchport trunk encapsulation dot1q

Notes:

Interface f0/1 SW2 terhubung langsung dengan R1. Agar Trunking dapat berfungsi maka kedua interface yang saling terhubung harus mengaktifkan mode trunk. Di SW2 ini perlu menambahkan command switchport mode trunk. Dikarenakan switch ini terhubung dengan router yang interfacenya terkonfigurasi encapsulation dot1q, maka interface pada switch ini juga perlu dikonfigurasi dengan encapsulation trunk dengan command switchport trunk encapsulation dot1q.

21) Verify the Eng1 PC has connectivity to the VLAN 20 interface on R1.

Notes:

PC Eng1 sudah dapat terhubung dengan VLAN 20 di R1, itu artinya R1 sudah dapat menghubungkan VLAN 10 dan VLAN 20.

22) Verify the Eng1 PC has connectivity to Sales1.

Notes:

PC Eng1 sudah dapat terhubung dengan PC Sales1, itu artinya PC Eng dan PC Sales sudah saling terhubung meskipun berada pada VLAN yang berbeda.

23) Clean-up: Shut down interface FastEthernet0/0 on R1.

R1(config)#int f0/0

R1(config-if)#shutdown

Inter-VLAN Routing — Option 3 Layer 3 Switch

24) Enable layer 3 routing on SW2.

SW2(config)#ip routing

Notes:

Secara default SW2 berperan sebagai Switch biasa. Lalu, Ketika kita masukkan command IP Routing. Maka SW2, mengaktifkan fitur Routing disertai dengan Inter-VLAN yang dibutuhkan.

25) Configure SVIs on SW2 to support inter-VLAN routing between the Eng and Sales VLANs.

SW2(config)#int vlan 10

SW2(config-if)#ip add 10.10.10.1 255.255.255.0

SW2(config)#int vlan 20

SW2(config-if)#ip add 10.10.20.1 255.255.255.0

Notes:

Switch pada umumnya tidak dapat menghubungkan koneksi antar VLAN. Dengan MLS atau Multi Layer Switch, VLAN yang berbeda dapat terhubung dengan cara kita menambahkan interface vlan. Karena di jaringan ini terdapat 2 VLAN yaitu VLAN 10 dan VLAN 20, maka kita buat interface VLAN 10 dan interface VLAN 20. Jangan lupa untuk menambahkan IP pada kedua interface tersebut. IP address 10.10.10.1 untuk VLAN 10 dan IP address 10.10.20.1 untuk VLAN 20.

26) Verify the Eng1 PC has connectivity to the VLAN 20 interface on SW2.

Notes:

PC Eng1 sudah terkoneksi dengan VLAN 20. Maka dapat disimpulkan bahwa MLS sudah dapat menghubungkan VLAN 10 dan VLAN 20.

27) Verify the Eng1 PC has connectivity to Sales1.

Notes:

PC Eng1 sudah terkoneksi dengan PC Sales1. Maka dapat disimpulkan bahwa Seluruh PC Engineer dan PC Sales dapat terhubung meski mereka berada pada VLAn yang berbeda.

--

--

No responses yet