vlan trunk allowed

Syntax

vlan trunk allowed [<VLAN-LIST> | all]

no vlan trunk allowed [<VLAN-LIST>]

Description

Assigns a VLAN ID to an trunk interface. Multiple VLAN IDs can be assigned to a trunk interface. These VLAN IDs define which VLAN traffic is allowed across the trunk interface.

VLANs can be assigned only to a non-routed (layer 2) interface or LAG interface. By default, all interfaces are routed (layer 3) when created. Use the no routing command to disable routing on an interface.

The no form of this command removes one or more VLAN IDs from a trunk interface. When the last VLAN is removed from a trunk interface, the interface continues to operate in trunk mode, and will trunk all the VLANs currently defined on the switch, and any new VLANs defined in the future. To disable the trunk interface, use the command shutdown.

Command context

config-if

Parameters

<VLAN-LIST>

Specifies the VLAN IDs to assign to the interface, as a range of numbers, separated by commas (2, 3, 4), dashes (2-4), or both (2-4,6). The VLAN IDs must exist. Range: 1 - 4094.

all

Configures the trunk interface to allow all the VLANs currently configured on the switch and any new VLANs that are configured in the future.

Authority

Administrators

Examples

Assigning VLANs 2, 3, and 4 to trunk interface 1/1/2:

switch(config)# interface 1/1/2
switch(config-if)# no routing
switch(config-if)# vlan trunk allowed 2,3,4

Assigning VLAN IDs 2 to 8 to trunk interface 1/1/2:

switch(config)# interface 1/1/2
switch(config-if)# no routing
switch(config-if)# vlan trunk allowed 2-8

Assigning VLAN IDs 2 to 8 and 10 to trunk interface 1/1/2:

switch(config)# interface 1/1/2
switch(config-if)# no routing
switch(config-if)# vlan trunk allowed 2-8,10

Removing VLAN IDs 2, 3, and 4 from trunk interface 1/1/2:

switch(config)# interface 1/1/2
switch(config-if)# no vlan trunk allowed 2,3,4

Removing all VLANs assigned to trunk interface 1/1/2:

switch(config)# interface 1/1/2
switch(config-if)# no vlan trunk allowed