fir3net
PPS-Firenetbanner-780.5x190-30-03-17

Cisco Switch - How to add a VLAN to a Trunk

Within this article we will look at 2 commands used when allowing only certain VLAN`s across a trunk.

Allow VLAN

To add just vlan 150 to the trunk, (once in the interface sub command) use,

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

Show Command

A good command for troubleshooting is shown below.

Switch1#show int fa 0/14 switchport
    Name: Fa0/14
    Switchport: Enabled
    Administrative mode: trunk
    Operational Mode: trunk
    Administrative Trunking Encapsulation: dot1q
    Operational Trunking Encapsulation: dot1q
    Negotiation of Trunking: Disabled
    Access Mode VLAN: 0 ((Inactive))
    Trunking Native Mode VLAN: 1 (default)
    Trunking VLANs Enabled: ALL
    Trunking VLANs Active: 1,100,150,200,250,500
    Pruning VLANs Enabled: 2-1001

Config Example

interface FastEthernet0/10
  switchport trunk encapsulation dot1q
  switchport trunk allowed vlan 1,150,250,1002-1005
  switchport mode trunk
  spanning-tree portfast
  no cdp enable
  !
interface FastEthernet0/14
  switchport trunk encapsulation dot1q
  switchport trunk allowed vlan 1-149,151-1005
  switchport mode trunk
  spanning-tree portfast
  no cdp enable
  !
interface FastEthernet0/15
  switchport trunk encapsulation dot1q
  switchport trunk allowed vlan 1-149,151-1005
  switchport mode trunk
  spanning-tree portfast
  no cdp enable

About the Author

RDonato

R Donato

Rick Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001