-->
🏠 🔍
SHAREOLITE

Cisco switch create Trunk , Assign VLAN to trunk , View trunk properties

In this post , we share step by step tested and working command line procedures to enable Trunk/ VLAN tagged ports on a Cisco switch and cover the following topics

  • How to create and enable a Trunk port
  • How to assign VLANs to a Trunk port
  • How to View the trunk properties
  • How to Disable a Trunk port.
How to create and enable a Trunk port


Switch1# config terminal

Select the interface port which has to be set as trunk port

Switch1(config)#interface f1/0/1

If this trunk carries traffic of more than one VLAN enable 802.1q support

Switch1(config-if)#switchport trunk encapsulation dot1q

Set the port mode to trunk

Switch1(config-if)#switchport mode trunk


Activate the trunk port

Switch1(config-if)#no shut

Switch1(config-if)#^Z

How to assign VLANs to a Trunk port

By default when 802.1q VLAN tagging is enabled , all the VLANs will be automatically assigned to the trunk port. However specific VLANs may be allowed / disallowed using the below commands.

Switch1#  config t
Switch1(config)#interface f3/0/33


To remove VLAN 200 from the trunk.

Switch1(config-if)# switchport trunk allowed vlan remove 200
Switch1(config-if)#^Z

To allow VLAN 100 on the trunk port

Switch1(config-if)#switchport trunk allowed vlan add 100
Switch1(config-if)#


To allow all VLANs expect VLAN 300 on trunk port

Switch1(config-if)#
Switch1(config-if)#switchport trunk allowed vlan except 200


To allow all VLANs traffic on the trunk port

Switch1(config-if)#
Switch1(config-if)#switchport trunk allowed vlan all
Switch1(config-if)#


How to view the trunk port properties

Switch1 # show int f1/0/1 trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa1/0/1    on               802.1q         trunking      1

Port        Vlans allowed on trunk
Fa1/0/1    1-4094

Port        Vlans allowed and active in management domain
Fa1/0/1    1,100,200                (VLANs will be displayed only when cable is connected to port)

Port        Vlans in spanning tree forwarding state and not pruned
Fa1/0/1    none


Switch1# show interfaces trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa1/0/1    on               802.1q         trunking      1

Port        Vlans allowed on trunk
Fa1/0/1    1-4094

Port        Vlans allowed and active in management domain
Fa1/0/1    1,100,200

Port        Vlans in spanning tree forwarding state and not pruned
Fa1/0/1    1,100,200

Switch1 # show interfaces f1/0/1  switchport
Name: Fa1/0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

How to disable a trunk port

Switch1(config)#interface f1/0/1
Switch1(config-if)#no switchport trunk encapsulation dot1q
Switch1(config-if)#no switchport mode trunk
Switch1(config-if)#switchport mode access 

Hope this helps some Cisco switch learning beginners.

Comments

–>