cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

hardware:cisco:vlan.html



Cisco VLAN Configuration Examples

Show

Operation Command
To display VLAN information switch# show vlan
switch# show vlan brief ← Displays only a single line
Display Trunk switch(config)# show interfaces trunk
Check Port's Trunk switch(config)# show interfaces PORT trunk
switch(config)# show interfaces fa0/11 trunk



Createing VLAN

Switch#conf t                        ← configure terminal
Switch(conf)#vlan 10                 ← make VLAN 10
Switch(config-vlan)#name VLAN10      ← "vlan 10"'s Name is VLAN10.
Switch(config-vlan)#end
Switch#
Switch#show vlan brief              ← Check


Deleteing VLAN

Switch#conf t                        ← configure terminal
Switch(conf)# no vlan 10
Switch(config-vlan)#end
Switch#
Switch#show vlan brief              ← Check

Deleteing VLAN Interface

Switch(conf)# no interface Vlan10
or
Switch(conf)# no interface vlan 10
Check
Swtich# show vlan


Access Port (1 VLAN)

Add VLAN to interface port.

Switch#conf t
Switch(config)#interface fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#end
Switch#
Switch#show vlan brief              ← Check


Trunk Port (Multiple VLAN)

Switch# configure terminal
Switch(config)#
Switch(config)# interface fa0/8
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport nonegotiate
Switch(config-if)# end
Switch#
Switch# show interfaces trunk

Permit VLAN

Switch(config)# interface GigabitEthernet 0/1
Switch(config-if)# switchport trunk allowed vlan vlan 10,20,30

#Example VLAN_NO
vlan 1-3
vlan 10,20,30
vlan 1-3,10

Add VLAN

Switch(config)# vlan VLAN_NO   <- add vlan

Switch(config)# interface GigabitEthernet 0/1
Switch(config-if)# switchport trunk allowed vlan add 40,50

Delete VLAN

Switch(config)# interface GigabitEthernet 0/1
Switch(config-if)# switchport trunk allowed vlan remove VLAN_NO

#Example
Switch(config-if)# switchport trunk allowed vlan remove 15,16


EtherChannel

Add VLAN for the Port-channel

Switch1(config)# interface port-channel 1
Switch1(config-if)# switchport trunk allowed vlan add 93

Delete VLAN from Port-channel

Switch1(config)# interface port-channel 1
Switch1(config-if)# switchport trunk allowed vlan remove 93


Magagement IP adresss to VLAN interface

Switch#
Switch#conf t
Switch(config)#interface vlan 1
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#exit
Switch#

SVI(Switch Virtual Interface)




hardware/cisco/vlan.html.txt · Last modified: 2022/02/24 by admin

Page Tools