vlan树干允许d

Syntax

vlan树干允许d [| all] no vlan trunk allowed []

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 theno routingcommand to disable routing on an interface.

Thenoform 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 commandshutdown.

Command context

config-if

Parameters

Specifies a single ID, or a series of IDs separated by commas (2, 3, 4), dashes (2-4), or both (2-4,6). Range: 1 to4094.

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 or local user group members with execution rights for this command.

Examples

Assigning VLANs2,3, and4to trunk interface1/1/2:

switch(config)#interface 1/1/2switch(config-if)#no routingswitch(config-if)#vlan树干允许d 2,3,4

Assigning VLAN IDs2to8to trunk interface1/1/2:

switch(config)#interface 1/1/2switch(config-if)#no routingswitch(config-if)#vlan树干允许2 - 8

Assigning VLAN IDs2to8and 10 to trunk interface1/1/2:

switch(config)#interface 1/1/2switch(config-if)#no routingswitch(config-if)#vlan树干允许2 - 8,10

Removing VLAN IDs2,3, and4from trunk interface1/1/2:

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

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

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