Med hjälp av en laboration från Cisco tas upp här hur VLAN skapas, konfigureras, raderas, port-tilldelning, trunking.
Studera en stund nätverkstopologin nedan där switch S1 och S2 ansluts med varandra via en trunk-uppkoppling.
- S1 har VLAN 10, VLAN 20 och VLAN 99 med namn Student, Faculty, och Management.
- S2 har VLAN 10, VLAN 20 och VLAN 99 med namn Student, Faculty, och Management.
- S1 VLAN 10 tilldelas access-port F0/6, VLAN 99 access-port F0/2, trunk-port F01
- S2 VLAN 10 tilldelas access-port F0/11, VLAN 20 access-port F0/18, VLAN 99 access-port F0/2, och trunk-port F0/1
- S1 VLAN Management IP-adress 192.168.1.11/24. Till nätverkstopologin lägger du till en PC ansluten till port F0/2 och testar Telnet uppkoppling
- S2 VLAN Management IP-adress 192.168.1.12/24. Till nätverkstopologin lägger du till en PC ansluten till port F0/2 och testar Telnet uppkoppling
Utförande av laborationen tar oss genom flera olika konfigurationer:
- Grundkonfigurationer
- VLAN skapande och port-tilldelning
- VLAN port-tilldelning och VLAN databas
- Trunk konfigurering mellan switcharna
- Radera VLAN databas
Observera ingen router i topologin.

Konfigurationer
- Grundkonfiguration på switch S1
- Switch> enable
- Switch# configure terminal
- Switch(config)# hostname S1
- S1(config)# no ip domain-lookup
- S1(config)# service password-encryption
- S1(config)# enable secret enpass
- S1(config)# banner motd # Unauthorized access is strictly prohibited. #
- S1(config)# line console 0
- S1(config-line)# password conpass
- S1(config-line)# login
- S1(config-line)# logging synchronous
- S1(config-line)# exit
- S1(config)# line vty 0 15
- S1(config-line)# password vtypass
- S1(config-line)# login
- S1(config-line)# logging synchronous
- S1(config-line)# end
- S1#
- Grundkonfiguration på switch S2
- Switch> enable
- Switch# configure terminal
- Switch(config)# hostname S2
- S2(config)# no ip domain-lookup
- S2(config)# service password-encryption
- S2(config)# enable secret enpass
- S2(config)# banner motd # Unauthorized access is strictly prohibited. #
- S2(config)# line console 0
- S2(config-line)# password conpass
- S2(config-line)# login
- S2(config-line)# logging synchronous
- S2(config-line)# exit
- S2(config)# line vty 0 15
- S2(config-line)# password vtypass
- S2(config-line)# login
- S2(config-line)# logging synchronous
- S2(config-line)# end
- S2#
- VLAN på switch 1
- S1# configure terminal
- S1(config)# vlan 10
- S1(config-vlan)# name Student
- S1(config-vlan)# vlan 20
- S1(config-vlan)# name Faculty
- S1(config-vlan)# vlan 99
- S1(config-vlan)# name Management
- S1(config-vlan)# end
- S1# show vlan
- Associera VLAN till rätt interface
- S1# configure terminal
- S1(config)# interface fa0/6
- S1(config-if)# switchport mode access
- S1(config-if)# switchport access vlan 10
- S1(config-if)# exit
- Nollställ VLAN 1 och adressera VLAN 99
- S1(config)# interface vlan 1
- S1(config-if)# no ip address
- S1(config-if)# exit
- S1(config)# interface vlan 99
- S1(config-if)# ip address 192.168.1.11 255.255.255.0
- S1(config-if)# end
- S1# show vlan brief
- S1# show ip interface brief
- VLAN på switch 2
- S2# configure terminal
- S2(config)# vlan 10
- S2(config-vlan)# name Student
- S2(config-vlan)# vlan 20
- S2(config-vlan)# name Faculty
- S2(config-vlan)# vlan 99
- S2(config-vlan)# name Management
- S2(config-vlan)# end
- S2# show vlan
- Associera VLAN till rätt interface
- S2# configure terminal
- S2(config)# interface fa0/11
- S2(config-if)# switchport mode access
- S2(config-if)# switchport access vlan 10
- S2(config-if)# exit
- S2(config)# interface fa0/18
- S2(config-if)# switchport mode access
- S2(config-if)# switchport access vlan 20
- S2(config-if)# exit
- Tilldela interface fa0/11 - 24 till VLAN 10
- S1(config)# interface range fa0/11 - 24
- S1(config-if-range)# switchport mode access
- S1(config-if-range)# switchport access vlan 10
- S1(config-if-range)# end
- S1# show vlan brief
- Tilldela om interface fa0/11 och fa0/21 till VLAN 20
- S1# configure terminal
- S1(config)# interface range fa0/11, fa0/21
- S1(config-if-range)# switchport access vlan 20
- S1(config-if-range)# end
- S1# show vlan brief
- Ta bort tilldelat interface fa0/24 från VLAN 10
- S1(config)# interface fa0/24
- S1(config-if)# no switchport access vlan
- S1(config-if)# end
- S1# show vlan brief
- Ta bort VLAN ID från VLAN databasen
- Lägg till VLAN 30 och associera det med interfacet fa0/24
- S1(config)# interface fa0/24
- S1(config-if)# switchport access vlan 30
- Felmeddelande visas och VLAN 30 skapas.
- S1(config-if)# end
- S1# show vlan brief
- S1# configure terminal
- S1(config)# no vlan 30
- S1(config-if)# end
- S1# show vlan brief
- S1# configure terminal
- S1(config)# interface fa0/24
- S1(config-if)# no switchport access vlan
- S1(config-if)# end
- S1# show vlan brief
- Använd default DTP läge
- S1# configure terminal
- S1(config)# interface fa0/1
- S1(config-if)# switchport mode dynamic desirable
- S1(config-if)# end
- S1# show vlan brief
- S1# show interfaces trunk
- Konfigurera trunk interface fa0/1 på switch 1
- S1# configure terminal
- S1(config)# interface fa0/1
- S1(config-if)# switchport mode trunk
- S1(config)# end
- S1#
- Konfigurera trunk interface fa0/1 på switch 2
- S2# configure terminal
- S2(config)# interface fa0/1
- S2(config-if)# switchport mode trunk
- S2(config)# end
- S2#
- Verifera om filen vlan.dat existerar
- S1# show flash
- Radera VLAN databasen
- S1# delete vlan.dat
- S1# show flash
- S1# show interface fa0/1 switchport
- S1# configure terminal
- S1(config)# vlan 100
- S1(config-vlan)# name Native
- S1(config-vlan)# exit
- S1(config)# interface fa0/1
- S1(config-if)# switchport trunk native vlan 100
- S1(config-if)# end
- S1# show interface fa0/1 switchport
- S2#
- S2# show interface fa0/1 switchport
- S2# configure terminal
- S2(config)# vlan 100
- S2(config-vlan)# name Native
- S2(config-vlan)# exit
- S2(config)# interface fa0/1
- S2(config-if)# switchport trunk native vlan 100
- S2(config-if)# end
- S2# show interface fa0/1 switchport
- PC-A 192.168.10.3/24, DG 192.168.10.1
- PC-B 192.168.10.4/24, DG 192.168.10.1
- PC-C 192.168.20.3/24, DG 192.168.10.1