Setting Virtual LAN (VLAN) pada jaringan komputer

Kali ini saya akan membahas tentang Setting Virtual LAN ( Vlan ) ada switch. Di sini saya menggunakan Packet Tracer sebagai perantaranya.

Pertama, desain jaringan yang diinginkan seperti pada gambar berikut ini :

Capturejarkom

Konfigurasi pada Switch 0

 

Switch>en

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#vlan 10

Switch(config-vlan)#name VLAN_10

Switch(config-vlan)#exit

Switch(config)#int fa0/1

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 10

Switch(config-if)#exit

Switch(config)#vlan 20

Switch(config-vlan)#name VLAN_20

Switch(config-vlan)#exit

Switch(config)#int fa0/2

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 20

Switch(config-if)#exit

Switch(config)#vlan 30

Switch(config-vlan)#name VLAN_30

Switch(config-vlan)#exit

Switch(config)#int fa0/3

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 30

Switch(config-if)#exit

Switch(config)#do show vlan

VLAN Name                             Status    Ports

—- ——————————– ——— ——————————-

1    default                          active    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, Gig1/1, Gig1/2

10   VLAN_10                          active    Fa0/1

20   VLAN_20                          active    Fa0/2

30   VLAN_30                          active    Fa0/3

1002 fddi-default                     act/unsup

1003 token-ring-default               act/unsup

1004 fddinet-default                  act/unsup

1005 trnet-default                    act/unsup

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2

—- —– ———- —– —— —— ——– —- ——– —— ——

1    enet  100001     1500  –      –      –        –    –        0      0

10   enet  100010     1500  –      –      –        –    –        0      0

20   enet  100020     1500  –      –      –        –    –        0      0

30   enet  100030     1500  –      –      –        –    –        0      0

1002 fddi  101002     1500  –      –      –        –    –        0      0

1003 tr    101003     1500  –      –      –        –    –        0      0

1004 fdnet 101004     1500  –      –      –        ieee –        0      0

1005 trnet 101005     1500  –      –      –        ibm  –        0      0

Remote SPAN VLANs

——————————————————————————

Primary Secondary Type              Ports

——- ——— —————– ——————————————

Switch(config)#int vlan 10

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

Switch(config-if)#no shut

Switch(config-if)#ip add 192.168.1.2 255.255.255.0

Switch(config-if)#exit

Switch(config)#int vlan 20

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

no shut

Switch(config-if)#no shut

Switch(config-if)#ip add 192.168.2.2 255.255.255.0

Switch(config-if)#exit

Switch(config)#int vlan 30

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan30, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up

Switch(config-if)#no shut

Switch(config-if)#ip add 192.168.3.2 255.255.255.0

Switch(config-if)#exit

Switch(config)#int g1/1

Switch(config-if)#switch mode trunk

Switch(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1, changed state to up

Switch(config-if)#exit

Switch(config)#vtp mode transparent

Setting device to VTP TRANSPARENT mode.

Switch(config)#do show run

Building configuration…

Current configuration : 1451 bytes

!

version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Switch

!

!

vtp mode transparent

!

!

vlan 10

name VLAN_10

!

vlan 20

name VLAN_20

!

vlan 30

name VLAN_30

!

interface FastEthernet0/1

switchport access vlan 10

switchport mode access

!

interface FastEthernet0/2

switchport access vlan 20

switchport mode access

!

interface FastEthernet0/3

switchport access vlan 30

switchport mode access

!

interface FastEthernet0/4

!

interface FastEthernet0/5

!

interface FastEthernet0/6

!

interface FastEthernet0/7

!

interface FastEthernet0/8

!

interface FastEthernet0/9

!

interface FastEthernet0/10

!

interface FastEthernet0/11

!

interface FastEthernet0/12

!

interface FastEthernet0/13

!

interface FastEthernet0/14

!

interface FastEthernet0/15

!

interface FastEthernet0/16

!

interface FastEthernet0/17

!

interface FastEthernet0/18

!

interface FastEthernet0/19

!

interface FastEthernet0/20

!

interface FastEthernet0/21

!

interface FastEthernet0/22

!

interface FastEthernet0/23

!

interface FastEthernet0/24

!

interface GigabitEthernet1/1

switchport mode trunk

!

interface GigabitEthernet1/2

!

interface Vlan1

no ip address

shutdown

!

interface Vlan10

ip address 192.168.1.2 255.255.255.0

!

interface Vlan20

ip address 192.168.2.2 255.255.255.0

!

interface Vlan30

ip address 192.168.3.2 255.255.255.0

!

!

line con 0

!

line vty 0 4

login

line vty 5 15

login

!

!

end

Lalu lakukan :

Pinging dari PC0 ke PC3

Pinging dari PC1 ke PC4

Pinging dari PC2 ke PC5

Konfigurasi pada Switch 1

Switch>en

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#vlan 10

Switch(config-vlan)#name VLAN_10

Switch(config-vlan)#exit

Switch(config)#vlan 20

Switch(config-vlan)#name VLAN_20

Switch(config-vlan)#exit

Switch(config)#vlan 30

Switch(config-vlan)#name VLAN_30

Switch(config-vlan)#exit

Switch(config)#int fa0/11

Switch(config-if)#switchport mode access

Switch(config-if)#switch access vlan 10

Switch(config-if)#exit

Switch(config)#int fa 0/12

Switch(config-if)#switchport mode access

Switch(config-if)#switch access vlan 20

Switch(config-if)#exit

Switch(config)#int fa 0/13

Switch(config-if)#switchport mode access

Switch(config-if)#switch access vlan 30

Switch(config-if)#exit

Switch(config)#do show vlan

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/14, Fa0/15

Fa0/16, Fa0/17, Fa0/18, Fa0/19

Fa0/20, Fa0/21, Fa0/22, Fa0/23

Fa0/24, Gig1/2

10   VLAN_10                          active    Fa0/11

20   VLAN_20                          active    Fa0/12

30   VLAN_30                          active    Fa0/13

1002 fddi-default                     act/unsup

1003 token-ring-default               act/unsup

1004 fddinet-default                  act/unsup

1005 trnet-default                    act/unsup

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2

—- —– ———- —– —— —— ——– —- ——– —— ——

1    enet  100001     1500  –      –      –        –    –        0      0

10   enet  100010     1500  –      –      –        –    –        0      0

20   enet  100020     1500  –      –      –        –    –        0      0

30   enet  100030     1500  –      –      –        –    –        0      0

1002 fddi  101002     1500  –      –      –        –    –        0      0

1003 tr    101003     1500  –      –      –        –    –        0      0

1004 fdnet 101004     1500  –      –      –        ieee –        0      0

1005 trnet 101005     1500  –      –      –        ibm  –        0      0

Remote SPAN VLANs

——————————————————————————

Primary Secondary Type              Ports

——- ——— —————– ——————————————

Switch(config)#

Switch(config)#int vlan 10

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

Switch(config-if)#no shut

Switch(config-if)#ip add 192.168.1.4 255.255.255.0

Switch(config-if)#exit

Switch(config)#int vlan 20

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

Switch(config-if)#no shut

Switch(config-if)#ip add 192.168.2.4 255.255.255.0

Switch(config-if)#exit

Switch(config)#int vlan 30

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan30, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up

Switch(config-if)#no shut

Switch(config-if)#ip add 192.168.3.4 255.255.255.0

Switch(config-if)#exit

Switch(config)#int g1/1

Switch(config-if)#switchport mode trunk

Switch(config-if)#exit

Switch(config)#vtp mode transparent

Setting device to VTP TRANSPARENT mode.

Switch(config)#do show run

Building configuration…

Current configuration : 1451 bytes

!

version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Switch

!

!

vtp mode transparent

!

!

vlan 10

name VLAN_10

!

vlan 20

name VLAN_20

!

vlan 30

name VLAN_30

!

interface FastEthernet0/1

!

interface FastEthernet0/2

!

interface FastEthernet0/3

!

interface FastEthernet0/4

!

interface FastEthernet0/5

!

interface FastEthernet0/6

!

interface FastEthernet0/7

!

interface FastEthernet0/8

!

interface FastEthernet0/9

!

interface FastEthernet0/10

!

interface FastEthernet0/11

switchport access vlan 10

switchport mode access

!

interface FastEthernet0/12

switchport access vlan 20

switchport mode access

!

interface FastEthernet0/13

switchport access vlan 30

switchport mode access

!

interface FastEthernet0/14

!

interface FastEthernet0/15

!

interface FastEthernet0/16

!

interface FastEthernet0/17

!

interface FastEthernet0/18

!

interface FastEthernet0/19

!

interface FastEthernet0/20

!

interface FastEthernet0/21

!

interface FastEthernet0/22

!

interface FastEthernet0/23

!

interface FastEthernet0/24

!

interface GigabitEthernet1/1

switchport mode trunk

!

interface GigabitEthernet1/2

!

interface Vlan1

no ip address

shutdown

!

interface Vlan10

ip address 192.168.1.4 255.255.255.0

!

interface Vlan20

ip address 192.168.2.4 255.255.255.0

!

interface Vlan30

ip address 192.168.3.4 255.255.255.0

!

!

line con 0

!

line vty 0 4

login

line vty 5 15

login

!

!

End

Lalu lakukan :

Pinging dari PC3 ke PC0

Pinging dari PC4 ke PC1

Pinging dari PC4 ke PC2

Setelah semua ter-reply, berarti VLAN telah terkonfigurasi:)

Untuk penjelasan lebih jelasnya dapat didownload disini

2 thoughts on “Setting Virtual LAN (VLAN) pada jaringan komputer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s