Deleting multiple VLANs

The interface command enables you to add or delete interfaces from multiple tagged or untagged VLANs or SVLANs using a single command. Interfaces can be added or deleted for up to 256 VLANs at a time. If more than 256 VLANs are specified, an error is displayed. The forbid option prevents an interface from becoming a member of the specified VLANs or SVLANs when used with GVRP.

Syntax

interface <port-list> <tagged | untagged | forbid> <vlan | svlan <vlan-id-list>>
no interface <port-list> <tagged | untagged | forbid> <vlan | svlan <vlan-id-list>>
  • The specified interfaces are added to existing VLANs or SVLANs. If a VLAN or SVLAN does not exist, an error message displays.

  • The no form of the command removes the specified interfaces from the specified VLANs or SVLANs.

  • The forbid option prevents an interface from becoming a member of the specified VLANs or SVLANs. It is executed in interface context.

Removing an interface from several VLANs

The vlan-id-list includes a comma-separated list of VLAN IDs and/or VLAN ID ranges.

To remove interface 1 from VLANs 1, 3, 5, 6, 7, 8, 9, 10

switch(config)# no interface 1,6,7-10 tagged vlan 1,3,5-10

To specify that an interface cannot become a member of VLANs 4 and 5

switch(config)# interface 2 forbid vlan 4-5