Switch CLI Reference Guide

VLAN Commands

vlan
Command Objective

This command creates a VLAN ID and enters into the config- VLAN mode in which VLAN specific configurations are done. This command directly enters into the config-VLAN mode for the specified VLAN ID, if the VLAN is already created.

  • <vlan –id> - This is a unique value that represents the specific VLAN. This value ranges between 1 and 4094.

Syntax

vlan <vlan-id>

no vlan <vlan-id>

Mode Global Configuration Mode/ Switch Configuration Mode
ports
Command Objective

This command statically configures a VLAN entry with the required member ports, untagged ports and/or forbidden ports, and activates the VLAN. The VLAN can also be activated using the vlan active command.

Syntax

ports [add] ([<interface-type> <0/a-b,0/c,...>] [<interface- type> <0/a-b,0/c,...>] [port-channel <a,b,c-d>] [pw <a,b,c-d>] [pw <a,b,c-d>]) [untagged (<interface-type> <0/a-b,0/c,...> [<interface-type> <0/a-b,0/c,...>] [port-channel <a,b,c-d>] [pw <a,b,c-d>] [ac <a,b,c-d>] [all])] [forbidden <interface-type><0/a-b,0/c,...> [<interface-type> <0/a-b,0/c,...>] [port-channel <a,b,c-d>] [pw <a,b,c-d>][ac <a,b,c-d>]] [name <vlan- name>]

no ports [<interface-type> <0/a-b,0/c,...>] [<interface-type><0/a-b,0/c,...>] [port-channel <a,b,c-d>] [pw <a,b,c-d>] [ac<a,b,c-d>] [all] [untagged ([<interface-type> <0/a-b,0/c,...>] [<interface-type> <0/a-b,0/c,...>] [port-channel <a,b,c-d>] [pw<a,b,c-d>] [ac <a,b,c-d>] [all])] [forbidden ([<interface-type><0/a-b,0/c,...>] [<interface-type> <0/a-b,0/c,...>] [port-channel <a,b,c-d>] [pw <a,b,c-d>] [ac <a,b,c-d>] [all])] [name<vlan-name>]

Parameter Description
  • add - Appends the new configured ports to the existing member port list of the vlan.

  • <interface-type> <0/a-b,0/c,...> - Configures the ports that should be set as a member of the VLAN.

  • port-channel<a,b,c-d> - Sets the list of port channel interfaces or a specific port channel identifier. Use comma as a separator without space while configuring list of interfaces. Example: 1,3.

  • pw <a,b,c-d> - Configures the Pseudo wire interface as member port. When the pseudo wire interface is mapped to a specific VLAN, the interface structures are created. This value ranges between 1 and 65535.

    • Maximum number of PseudoWire interfaces supported in the system is 100.

  • ac <a,b, c-d> - Configures the specified attachment circuit interface as a member port. This value ranges between 1 and 65535. Use comma as a separator without space while configuring list of interfaces. Example: 1,3.

  • all- Deletes all configured member ports for the VLAN and sets the member ports as none. This option is available only in the no form of the command.

  • untagged<interface-type> <0/a-b,0/c,...> - Configures the ports that should be used for the VLAN to transmit egress packets as untagged packets.

  • forbidden<interface-type> <0/a-b,0/c,...> - Configures the ports that should never receive packets from the VLAN.

  • name<vlan-name> - Configures the unique name of the VLAN. This name is used to identify the VLAN and is an administratively assigned string with the maximum size as 32.

Mode Config-VLAN Mode
exit
Command Objective

This command exits the current mode and reverts to the mode used prior to the current mode.

Syntax

exit

Description This command exits the current mode and reverts to the mode used prior to the current mode.
Mode All mode
switchport pvid
Command Objective

This command configures the PVID on the specified port.The PVID represents the VLAN ID that is to be assigned to untagged frames or priority-tagged or C-VLAN frames received on the port. The PVID is used for port based VLAN type membership classification. This value ranges between 1 and 65535.

Syntax

switchport pvid <vlan-id>

no switchport pvid

Parameter Description
  • pvid<vlan-id(1-4094)> - Configures the PVID for the provider edge port for the specified VLAN ID. This is a unique value that represents the specific VLAN. This value ranges between 1 and 4094.

Mode Interface Configuration mode (Physical / Port channel)
switchport acceptable-frame-type
Command Objective

This command configures the type of VLAN dependant BPDU frames such as GMRP BPDU, that the port should accept during the VLAN membership configuration.

The no form of the command resets the acceptable frame type for the port to its default value.

This configuration does not affect VLAN independent BPDU frames such as GVRP BPDU and STP BPDU. It affects only the VLAN dependent BPDU frames.

Syntax

switchport acceptable-frame-type {all | tagged | untaggedAndPrioritytagged }

no switchport acceptable-frame-type

Parameter Description
  • all- Configures the acceptable frame type as all. All tagged, untagged and priority tagged frames received on the port are accepted and subjected to ingress filtering.

  • tagged - Configures the acceptable frame type as tagged.

  • untaggedAndPrioritytagged - Configures the acceptable frame type as untagged and priority tagged. Only the untagged or priority tagged frames received on the port are accepted and subjected to ingress filtering. The tagged frames received on the port are rejected.

Mode Interface Configuration mode (Physical / Port channel)
switchport ingress-filter
Command Objective

This command enables ingress filtering feature on the port.

The ingress filtering is applied for the incoming frames received on the port. Only the incoming frames of the VLANs that have this port in its member list are accepted. This configuration does not affect VLAN independent BPDU frames such as GVRP BPDU and STP BPDU. It affects only the VLAN dependent BPDU frames GMRP BPDU.

The no form of the command disables ingress filtering feature on the port. All incoming frames received on the port are accepted.

Syntax

switchport ingress-filter

no switchport ingress-filter

Mode Interface Configuration mode (Physical / Port channel)
show vlan
Command Objective

This command displays VLAN entry related information of all active VLANs and VLANs (that are not active) for which the port details are configured.

The information contain the member ports, untagged ports, forbidden ports, VLAN name and the status of that VLAN entry.

Syntax

show vlan [brief | id <vlan-range> | summary] [ switch <context_name>]

Parameter Description
  • brief - Displays the VLAN entry related information of all active VLANs and VLANs (that are not active) for which the port details are configured.

  • id <vlan-range> - Displays the VLAN entry related information for specified VLANs alone. This value denotes the VLAN ID range for which the information needs to be displayed. This value is a string whose maximum size is 9. For example, the value is provided as 4000-4010 to display the information for VLANs IDs from 4000 to 4010. The information is displayed only for the active VLANs and VLANs (that are not active) for which the port details are configured.

  • summary - Displays only the total number of VLANs existing in the Switch. This includes only the active VLANs and VLANs (that are not active) for which the port details are configured. The VLAN entry related information is not displayed.

  • switch <context_name> - Displays the VLAN entry related information or total number of existing VLANs, for the specified context. This value represents unique name of the Switch context. This value is a string whose maximum size is 32. This parameter is specific to multiple instance feature.

Mode Privileged EXEC Mode
show vlan device info
Command Objective

This command displays the VLAN global information that is applicable to all VLANs created in the Switch / all contexts.

The information contains VLAN status, VLAN oper status, GVRP

status, GMRP status, GVRP oper status, GMRP oper status, MAC- VLAN status, subnet-VLAN status, protocol-VLAN status, bridge mode of the Switch, VLAN base bridge mode, VLAN traffic class status, VLAN learning mode, VLAN version number, maximum VLAN ID supported, maximum number of VLANs supported and VLAN unicast MAC learning limit.

Syntax

show vlan device info [ switch <context_name>]

Parameter Description
  • switch <context_name> - Displays the VLAN global information that is applicable to all VLANs, for the specified context. This value represents unique name of the Switch context. This value is a string whose maximum size is 32. This parameter is specific to multiple instance feature.

Mode Privileged EXEC Mode
show vlan device capabilities
Command Objective

This command displays only the list of VLAN features such as traffic class feature, supported in the Switch / all contexts.

Syntax

show vlan device capabilities [ switch <context_name>]

Parameter Description
  • switch <context_name> - Displays the VLAN global information that is applicable to all VLANs, for the specified context. This value represents unique name of the Switch context. This value is a string whose maximum size is 32. This parameter is specific to multiple instance feature.

Mode Privileged EXEC Mode
show vlan port config
Command Objective

This command displays the VLAN related port specific information for all interfaces available in the Switch / all contexts. The information contains PVID, acceptable frame type, port mode, filtering utility criteria, default priority value and status of ingress filtering feature, GVRP module, GMRP module, restricted VLAN registration feature, restricted group registration feature, MAC-based VLAN membership, subnet based VLAN membership, protocol-VLAN based membership and port protected feature.

Syntax

show vlan port config [{port < interface-type > <ifnum> | switch <string(32)>}]

Parameter Description
  • <interface-type> - Displays the VLAN related port specific information for the specified interface.

    • gigabitethernet - A version of LAN standard architecture that supports data transfer up to 1 Gigabit per second.

  • switch <context_name> - Displays the VLAN global information that is applicable to all VLANs, for the specified context. This value represents unique name of the Switch context. This value is a string whose maximum size is 32. This parameter is specific to multiple instance feature.

Mode Privileged EXEC Mode
show vlan statistics
Command Objective

This command displays the unicast / broadcast statistics details of all active VLANs and VLANs (that are not active) for which the port details are configured.

The statistics details include VLAN ID, number of unicast packets received in the VLAN, number of multicast / broadcast packets received in the VLAN, number of unknown unicast packets flooded in the VLAN, number of known unicast packets forwarded in the VLAN, and number of known broadcast packets forwarded in the VLAN.

Syntax

show vlan statistics [vlan <vlan-range>] [ switch <context_name>]

Parameter Description
  • vlan <vlan-range> - Displays the unicast / broadcast statistics details for specified VLANs alone. This value denotes the VLAN ID range for which the details need to be displayed. This value is a string whose maximum size is 9. For example, the value is provided as 4000-4010 to display the details for VLAN IDs from 4000 to 4010. The details are displayed only for the VLANs that are activated and VLANs (that are not active) for which the port details are configured.

  • switch <context_name> - Displays the VLAN global information that is applicable to all VLANs, for the specified context. This value represents unique name of the Switch context. This value is a string whose maximum size is 32. This parameter is specific to multiple instance feature.

Mode Privileged EXEC Mode
show mac-address-table
Command Objective

This command displays all static / dynamic unicast and multicast MAC entries created in the MAC address table. These entries contain VLAN ID, unicast / multicast MAC address, unicast backbone MAC address of peer backbone edge bridge, member ports, the type of entry (that is static, learnt and so on), and total number of entries displayed.

Syntax

show mac-address-table [vlan <vlan-range>] [address <aa:aa:aa:aa:aa:aa>] [{interface <interface-type> <interface-id> | switch <context_name>}]

Parameter Description
  • vlan <vlan-range> - Displays all static / dynamic unicast and multicast MAC entries created in the MAC address table for the specified VLANs alone. This value denotes the VLAN ID range for which the entries need to be displayed. This value is a string with the maximum size as 9. For example, the value is provided as 4000-4010 to display the entries for VLAN IDs from 4000 to 4010.

  • address <aa:aa:aa:aa:aa:aa> - Displays all static / dynamic unicast and multicast MAC entries created in the MAC address table for the specified unicast / multicast MAC address.

  • <interface-type> - Sets the type of interface.

    • gigabitethernet - A version of LAN standard architecture that supports data transfer up to 1 Gigabit per second.

  • switch <context_name> - Displays the VLAN global information that is applicable to all VLANs, for the specified context. This value represents unique name of the Switch context. This value is a string whose maximum size is 32. This parameter is specific to multiple instance feature.

Mode Privileged EXEC Mode
show mac-address-table count
Command Objective

This command displays the total number of static / dynamic unicast and multicast MAC address entries created in the FDB table. The count is displayed for all active VLANs, VLANs (that are not active) for which the port details are configured, and VLANs for which the MAC address table entries are created.

Syntax

show mac-address-table count [vlan <vlan-id/vfi-id>] [ switch <context_name>]

Parameter Description
  • vlan <vlan-id> - Displays the total number of static / dynamic unicast and multicast MAC address entries created for the specified VLAN ID. This value ranges between 1 and 65535.

  • switch <context_name> - Displays the VLAN global information that is applicable to all VLANs, for the specified context. This value represents unique name of the Switch context. This value is a string whose maximum size is 32. This parameter is specific to multiple instance feature.

Mode Privileged EXEC Mode
show mac-address-table static multicast
Command Objective

This command displays the static multicast MAC address entries created in the FDB table.

These entries contain VLAN ID to which multicast MAC address entry is assigned, multicast MAC address, member ports, receiver ports, forbidden ports, the status of entry (that is permanent, static and so on), and total number of entries displayed.

Syntax

show mac-address-table static unicast [vlan <vlan-range>] [address <aa:aa:aa:aa:aa:aa>] [{interface <interface-type> <interface-id> | switch <context_name>}]

Parameter Description
  • vlan <vlan-range> - Displays all static / dynamic unicast and multicast MAC entries created in the MAC address table for the specified VLANs alone. This value denotes the VLAN ID range for which the entries need to be displayed. This value is a string with the maximum size as 9. For example, the value is provided as 4000-4010 to display the entries for VLAN IDs from 4000 to 4010.

  • address <aa:aa:aa:aa:aa:aa> - Displays all static / dynamic unicast and multicast MAC entries created in the MAC address table for the specified unicast / multicast MAC address.

  • <interface-type> - Displays all static multicast MAC address entries for the specified interface.

    • gigabitethernet - A version of LAN standard architecture that supports data transfer up to 1 Gigabit per second.

  • switch <context_name> - Displays the VLAN global information that is applicable to all VLANs, for the specified context. This value represents unique name of the Switch context. This value is a string whose maximum size is 32. This parameter is specific to multiple instance feature.

Mode Privileged EXEC Mode
show mac-address-table dynamic unicast
Command Objective

This command displays all dynamically learnt unicast entries from the MAC address table.

These entries contain VLAN ID for which unicast MAC address entry is learnt, unicast MAC address, ports through which the entry is learnt, the status of entry (that is permanent, static and so on), the unicast backbone MAC address of peer backbone edge bridge, and total number of entries displayed.

Syntax

show mac-address-table dynamic unicast [vlan <vlan-range>] [address <aa:aa:aa:aa:aa:aa>] [{interface <interface-type><interface-id> | switch <context_name>}]

Parameter Description
  • vlan <vlan-range> - Displays all static / dynamic unicast and multicast MAC entries created in the MAC address table for the specified VLANs alone. This value denotes the VLAN ID range for which the entries need to be displayed. This value is a string with the maximum size as 9. For example, the value is provided as 4000-4010 to display the entries for VLAN IDs from 4000 to 4010.

  • address <aa:aa:aa:aa:aa:aa> - Displays all static / dynamic unicast and multicast MAC entries created in the MAC address table for the specified unicast / multicast MAC address.

  • <interface-type> - Displays all static multicast MAC address entries for the specified interface.

    • gigabitethernet - A version of LAN standard architecture that supports data transfer up to 1 Gigabit per second.

  • switch <context_name> - Displays the VLAN global information that is applicable to all VLANs, for the specified context. This value represents unique name of the Switch context. This value is a string whose maximum size is 32. This parameter is specific to multiple instance feature.

Mode Privileged EXEC Mode
show mac-address-table aging-time
Command Objective

This command displays the ageing time configured for the MAC address table. This time denotes the interval (in seconds) after which the dynamically learned forwarding information entry and static entry in the MAC address table are deleted.

Syntax

show mac-address-table aging-time [ switch <context_name>]

Parameter Description
  • switch <context_name> - Displays ageing time of the MAC address table, for the specified context. This value represents unique name of the switch context. This value is a string with the maximum size as 32. This parameter is specific to multiple instance feature.

Mode Privileged EXEC Mode

Example: 1

To assign an interface as a member of a vLAN as untagged or access port

Syntax

SWS14-48FPOE# conf t

SWS14-48FPOE(config)# vlan 100<![CDATA[ ]]>

SWS14-48FPOE(config-vlan)# ports add gigabitethernet 0/10 untagged gigabitethernet 0/10<![CDATA[ ]]>

SWS14-48FPOE(config-vlan)# end

SWS14-48FPOE# save

Expected results Switch port-10 becomes a member of vlan 100 as untagged or access port.

Example: 2

to assign multple interfaces as a member of a vLAN as untagged or access port

Syntax

SWS14-48FPOE# conf t

SWS14-48FPOE(config)# vlan 100

SWS14-48FPOE(config-vlan)# ports add gigabitethernet 0/10-20 untagged gigabitethernet 0/10-20

SWS14-48FPOE(config-vlan)# end

SWS14-48FPOE# save

Expected results Switch port-10 to 20 becomes a member of vlan 100 as untagged or access port.

Example: 3

To assign an interface as a member of a vlan as tagged or trunk port

Syntax

SWS14-48FPOE# conf t

SWS14-48FPOE(config)# vlan 100

SWS14-48FPOE(config-vlan)# ports add gigabitethernet 0/10

SWS14-48FPOE(config-vlan)# end

SWS14-48FPOE# save

Expected results Switch port-10 becomes a member of vlan 100 as tagged or trunk port.

Example: 4

To assign multiple interfaces as a member of a vlan as tagged or trunk port

Syntax

SWS14-48FPOE# conf t

SWS14-48FPOE(config)# vlan 100

SWS14-48FPOE(config-vlan)# ports add gigabitethernet 0/10-20

SWS14-48FPOE(config-vlan)# end

SWS14-48FPOE# save

Expected results Switch port 10 to 20 becomes a member of vlan 100 as tagged or trunk port.

Example: 5

To forbid an interface to become member of a vlan as untagged or tagged

Syntax

SWS14-48FPOE# conf t

SWS14-48FPOE(config)# vlan 100

SWS14-48FPOE(config-vlan)# ports add forbidden gigabitethernet 0/10

SWS14-48FPOE(config-vlan)# end

SWS14-48FPOE# save

Expected results Switch port-10 is not able to join vlan 100 as untagged or tagged (cannot become a member of vlan 100).

Example: 6

To forbid multiple interfaces to become member of a vlan as untagged or tagged

Syntax

SWS14-48FPOE# conf t

SWS14-48FPOE(config)# vlan 100

SWS14-48FPOE(config-vlan)# ports add forbidden gigabitethernet 0/10-20

SWS14-48FPOE(config-vlan)# end

SWS14-48FPOE# save

Expected results Switch port10 to 20 is not able to join vlan 100 as untagged or tagged (cannot become a member of vlan 100).

Example: 7

To assign an interface as a member of a vlan as tagged or trunk port and make other interface forbidden to that vlan

Syntax

SWS14-48FPOE# conf t

SWS14-48FPOE(config)# vlan 100

SWS14-48FPOE(config-vlan)# ports add gigabitethernet 0/10 forbidden gigabitethernet 0/11

SWS14-48FPOE(config-vlan)# end

SWS14-48FPOE# save

Expected results Switch port-10 becomes a member of vlan 100 as tagged or trunk port and port-11 is not able to join vlan 100 as untagged or tagged (cannot become a member of vlan 100).

Example: 8

To assign multiple interface as a member of a vlan as tagged or trunk port and make other interfaces forbidden to that vlan

Syntax

SWS14-48FPOE# conf t

SWS14-48FPOE(config)# vlan 100

SWS14-48FPOE(config-vlan)# ports add gigabitethernet 0/10-20 forbidden gigabitethernet 0/21-30

SWS14-48FPOE(config-vlan)# end

SWS14-48FPOE# save

Expected results Switch port 10 to 20 becomes a member of vlan 100 as tagged or trunk port and port 21-30 is not able to join vlan 100 as untagged or tagged (cannot become a member of vlan 100).

Example: 9

To assign an interface as a member of a vlan as untagged or access port and make other interface forbidden to that vlan

Syntax

SWS14-48FPOE# conf t

SWS14-48FPOE(config)# vlan 100

SWS14-48FPOE(config-vlan)# ports add gi 0/40 untagged gi 0/40 forbidden gi 0/41

SWS14-48FPOE(config-vlan)# end

SWS14-48FPOE# save

Example: 10

To assign an interface as a member of a vlan as untagged or access port and make other interfaces forbidden to that vlan

Syntax

SWS14-48FPOE# conf t

SWS14-48FPOE(config)# vlan 100

SWS14-48FPOE(config-vlan)# ports add gi 0/42-45 untagged gi 0/42-45 forbidden gi 0/46-48

SWS14-48FPOE(config-vlan)# end

SWS14-48FPOE# save

Was This Article Helpful?

Help us to improve our support portal

Techdocs Article Helpful form

  • Hidden
  • Hidden

Techdocs Article NOT Helpful form

  • Still can't find what you're looking for? Try our knowledge base or ask our community for more help.
  • Hidden
  • Hidden