Displaying a switch VLAN configuration

The show vlans command lists the VLANs currently running in the switch, with VID, VLAN name, and VLAN status. Dynamic VLANs appear only if the switch is running with GVRP enabled and one or more ports has dynamically joined an advertised VLAN. In the default configuration, GVRP is disabled.

Syntax:

show vlans

Primary VLAN

See The primary VLAN.

Management VLAN

See The secure Management VLAN.

802.1Q VLAN ID

The VLAN identification number, or VID.

Name

The default or specified name assigned to the VLAN. For a static VLAN, the default name consists of VLAN-x where x matches the VID assigned to that VLAN. For a dynamic VLAN, the name consists of GVRP_x where x matches the applicable VID.

Status

Port-Based

Port-Based, static VLAN

Protocol

Protocol-Based, static VLAN

Dynamic

Port-Based, temporary VLAN learned through GVRP

Voice

Indicates whether a port-based VLAN is configured as a voice VLAN. See Using voice VLANs.

Jumbo

Indicates whether a VLAN is configured for Jumbo packets. For more on jumbos, see "Port Traffic Controls" in the management and configuration guide for your switch.

This example shows the listing from the show vlans command. When GVRP is disabled (the default), Dynamic VLANs do not exist on the switch and do not appear in this listing. For more information, see GVRP.

Displaying VLAN listing with GVRP enabled

switch#: show vlans

 Status and Counters - VLAN Information

  Maximum VLANs to support : 256
  Primary VLAN : DEFAULT_VLAN
  Management VLAN :

  VLAN ID Name                 | Status     Voice Jumbo
  ------- -------------------- + ---------- ----- -----
  1       DEFAULT_VLAN         | Port-based No    No
  10      VLAN_10              | Port-based Yes   Yes
  15      VLAN_15              | Port-based No    No
  20      VLAN_20              | Protocol   No    No
  33      VLAN_33              | Dynamic    No    No

Viewing the VLAN membership of one or more ports (CLI)

Syntax:

show vlan ports <port-list> [detail]

Displays VLAN information for an individual port or a group of ports, either cumulatively or on a detailed per-port basis.

port-list

Specifies a single port number or a range of ports (for example, a1-a16), or all for which to display information.

detail

Displays detailed VLAN membership information on a per-port basis.

Descriptions of items displayed by the command are:

Port name

The user-specified port name, if one has been assigned.

VLAN ID

The VLAN identification number, or VID.

Name

The default or specified name assigned to the VLAN. For a static VLAN, the default name consists of VLAN-x where x matches the VID assigned to that VLAN. For a dynamic VLAN, the name consists of GVRP_x where x matches the applicable VID.

Status

Port-Based

Port-Based, static VLAN.

Protocol

Protocol-Based, static VLAN.

Dynamic

Port-Based, temporary VLAN learned through GVRP.

Voice

Indicates whether a port-based VLAN is configured as a voice VLAN.

Jumbo

Indicates whether a VLAN is configured for jumbo packets. For more on jumbos, see "Port Traffic Controls" in the management and configuration guide for your switch.

Mode

Indicates whether a VLAN is tagged or untagged.

Displaying VLAN ports (cumulative listing)

switch(config)#:show vlan ports a1-a24

Status and Counters - VLAN Information - for ports A1-A24

VLAN ID Name                 | Status     Voice Jumbo
------- -------------------- + ---------- ----- -----
1       DEFAULT_VLAN         | Port-based No    No
10      VLAN_10              | Port-based Yes   No
15      VLAN_15              | Protocol   No    No

Displaying VLAN ports (detailed listing)

switch(config)#:show vlan ports a1-a3 detail

Status and Counters - VLAN Information - for ports A1

VLAN ID Name                 | Status     Voice Jumbo Mode
------- -------------------- + ---------- ----- ----- --------
1       DEFAULT_VLAN         | Port-based No    No    Untagged
10      VLAN_10              | Port-based Yes   No    Tagged

Status and Counters - VLAN Information - for ports A2

VLAN ID Name                 | Status     Voice Jumbo Mode
------- -------------------- + ---------- ----- ----- --------
1       DEFAULT_VLAN         | Port-based No    No    Untagged
20      VLAN_20              | Protocol   No    No    Untagged

Status and Counters - VLAN Information - for ports A3

VLAN ID Name                 | Status     Voice Jumbo Mode
------- -------------------- + ---------- ----- ----- --------
1       DEFAULT_VLAN         | Port-based No    No    Untagged
33      VLAN_33              | Port-based No    No    Tagged

Viewing the configuration for a particular VLAN (CLI)

Syntax:

show vlans <vlan-id>

Uses the VID to identify and display the data for a specific static or dynamic VLAN.

802.1Q VLAN ID

The VLAN identification number, or VID.

Name

The default or specified name assigned to the VLAN. For a static VLAN, the default name consists of VLAN-x where x matches the VID assigned to that VLAN. For a dynamic VLAN, the name consists of GVRP_x where x matches the applicable VID.

Status

Port-Based

Port-Based, static VLAN.

Protocol

Protocol-Based, static VLAN

Dynamic

Port-Based, temporary VLAN learned through GVRP. See GVRP.

Voice

Indicates whether a port-based VLAN is configured as a voice VLAN. See Using voice VLANs.

Jumbo

Indicates whether a VLAN is configured for Jumbo packets. For more on jumbos, see "Port Traffic Controls" in the management and configuration guide for your switch.

Port Information

Lists the ports configured as members of the VLAN.

DEFAULT

Shows whether a port is a tagged or untagged member of the listed VLAN.

Unknown VLAN

Shows whether the port can become a dynamic member of an unknown VLAN for which it receives an advertisement. GVRP must be enabled to allow dynamic joining to occur.

Status

Shows whether the port is participating in an active link.

Displaying information for a specific static VLAN

switch(config)#:show vlans 22

Status and Counters - VLAN Information - VLAN 22

 VLAN ID : 22
 Name : VLAN22
 Status : Port-based
 Voice : Yes
 Jumbo : No

 Port Information Mode     Unknown VLAN Status
 ---------------- -------- ------------ ----------
 12               Untagged Learn        Up
 13               Untagged Learn        Up
 14               Untagged Learn        Up
 15               Untagged Learn        Down
 16               Untagged Learn        Up
 17               Untagged Learn        Up
 18               Untagged Learn        Up

Displaying information for a specific dynamic VLAN

The following example shows the information displayed for a specific dynamic VLAN. The show vlans command lists this data when GVRP is enabled and at least one port on the switch has dynamically joined the designated VLAN.

switch(config)#: show vlans 22

 Status and Counters - VLAN Information - VLAN 22

  VLAN ID : 33
  Name : GVRP_33
  Status : Dynamic
  Voice : No
  Jumbo : No

  Port Information Mode     Unknown VLAN Status
  ---------------- -------- ------------ ----------
  6                Auto     Learn        Up

Customizing the show VLANs output (CLI)

Syntax

show vlans custom [port <port-list>] <column-list>

Specifies the order you want information to display for the show vlans command. Displays information for one port or a range of ports. If <port-list> is not specified, all ports display.

Fields that can be included in the customized display:

Field Display Example Default width
id VLAN id 5 6
name VLAN name Vlan55 32
status Status Port-based 10
voice Voice enabled No 5
jumbo Jumbos enabled No 5
ipconfig How the IP address was configured

Manual

Disabled

DHCP/BootP

10

ipaddr (IPv4)

ipaddr (IPv6)

The IP addresses

10.10.10.3

fe80::212:79ff:fe8d:8000

15 for IPv4

46 for IPv6

ipmask The subnet masks

255.255.255.6

/64 (prefix for IPv6 is in format "/XX")

15
proxyarp Whether proxy ARP is configured No 5
localproxyarp Whether local proxy ARP is configured No 9
state "Up" if at least one port is up Up 5

Customizing the VLAN display

The following example displays id at its default width and name:20 allows up to 20 characters of the VLAN name to be displayed. The columns selected for display are separated by spaces.

If the width of the column requested is smaller than the header name of the column, the display of the header name is truncated.

switch(config)#: show vlan custom A1-A3 id name:20 ipaddr state

Status and Counters - VLAN Information - Custom view

VLANID VLAN name            IP Addr                            State
------ -------------------- ---------------------------------  -----
1      DEFAULT_VLAN         15.255.134.74                      Up
33     Vlan33               10.10.10.01                        Up
44     Vlan44               15.255.164.13                      Up
55     Vlan55               15.255.178.2                       Down
                            15.255.178.3
                            15.255.178.4
60     Vlan60               fe80::212:79ff:fe8d:8000%vlan60    Up

Wrapping column headers

The total output wraps if it is longer than the terminal width; it is not truncated.

switch(config)#: show vlan custom id
Status and Counters - VLAN Information - Custom view

 VLANID
 ------
 1
 33
 44

switch(config)#: show vlan custom id:2
Status and Counters - VLAN Information - Custom view

 VL
 --
 1
 33
 44

Using pattern matching with the show VLANs custom command

If a pattern matching command is in a search for a field in the output of the show vlan custom command and it produces an error, the error message may not be visible. For example, if you enter a command with the pattern matching include option that contains an error (such as 'vlan' is misspelled) as in the following example, the output may be empty:

switch(config)#: show vlans custom 1-3 name vlun include vlan1

Hewlett Packard Enterprise recommends that you try the show vlans custom command first to ensure that there is output and then enter the command again with the pattern matching option.

Creating an alias for show VLAN commands (CLI)

Create an alias for a frequently used show vlans custom command to avoid entering the selected columns each time you use the command.

Using a VLAN alias

switch(config)#: alias showvlanstatus = “show vlan custom A1-A3 id name:20 status”

switch(config)#: show vlan status
Status and Counters - VLAN Information - Custom view

VLANID VLAN name            Status
------ -------------------- ----------
1      DEFAULT_VLAN         Port-based
33     Vlan33               Port-based