switchport trunk allowed

Adds or removes VLANs on a Layer 2 interface in trunk mode.

Syntax

switchport trunk allowed { vlan | rspan-vlan } { add vlan_id { ctag { id | ctag - range } | all | except vlan_id | none | remove vlan_id }

Parameters

add vlan_id
Adds a VLAN to transmit and receive through the Layer 2 interface. The VLAN can be an 802.1Q VLAN, an RSPAN VLAN, or a transport VLAN.
all
Allows only 802.1Q VLANs to transmit and receive through the Layer 2 interface. This keyword does not apply to classified or transport VLANs.
ctag
Specifies an incoming C-TAG or range of C-TAGs for classified or transport VLANs.
id
C-TAG ID.
range
Range of C-TAG IDs, for example, 100-200, or 10,20,100-200, applicable only if the VLAN is a transport VLAN.
except vlan_id
Allows only 802.1Q VLANs except the specified VLAN ID to transmit and receive through the Layer 2 interface.
none
Allows only 802.1Q VLANs to transmit and receive through the Layer 2 interface. This keyword does not apply to service or transport VFs.
rspan-vlan vlan_id
Selects a VLAN for Remote Switched Port Analyzer (RSPAN) traffic monitoring.
remove vlan_id
Removes a VLAN that transmits and receives through the Layer 2 interface.

Modes

Interface subtype configuration mode

Usage Guidelines

A transport VF C-TAG can be any VLAN ID that is not used in other classifications or as a 802.1Q VLAN.

Examples

To add the tagged VLAN 100 to a specific Ethernet interface:

device# configure terminal
switch(config)# interface ethernet 0/9 
switch(conf-if-eth-0/9)# switchport trunk allowed vlan add 100 

To remove the tagged VLAN 100 from the interface:

device# configure terminal
switch(config)# interface ethernet 0/9 
switch(conf-if-eth-0/9)# switchport trunk allowed vlan remove 100 

Configure a classified VLAN with a C-TAG:

device# configure terminal
switch(config)# interface ethernet 0/1
switch(config-if-eth-0/1)# switchport trunk allowed vlan add 5000 ctag 100
switch(config-if-eth-0/1)# switchport trunk allowed vlan add 6000 ctag 200

An 802.1Q vlan specified as a user VLAN cannot be used as a C-TAG in a classified VLAN. The following show conflicts.

device# configure terminal
switch(config)# interface ethernet 0/1
switch(config-if-eth-0/1)# switchport trunk allowed vlan add 8000 ctag 100
switch(config-if-eth-0/1)# %Error: C-tag is already used. 
device# configure terminal
switch(config)# interface ethernet 0/1
switch(config-if-eth-0/1)# switchport trunk allowed vlan add 8000 ctag 888
switch(config-if-eth-0/1)# %Error: Ctag is configured in the allowed range on this port.