Cisco Switching: VLANs and Trunks

Cisco Switching: VLANs and Trunks

Creating and Assigning VLANs

Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name Sales
Switch(config-vlan)# exit
Switch(config)# interface gigabitethernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# exit

Configuring Trunk Ports

Switch(config)# interface gigabitethernet 0/24
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30
Switch(config-if)# switchport trunk native vlan 99

Verification Commands

  • show vlan brief
  • show interfaces trunk
  • show interfaces switchport