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:
Shows the number of VLANs the switch can currently support. Default is 256, Maximum 2048
See The primary VLAN.
The default or specified name assigned to the VLAN. For a static VLAN, the default name consists of
VLAN-x
wherex
matches the VID assigned to that VLAN. For a dynamic VLAN, the name consists ofGVRP_x
wherex
matches the applicable VID.
Indicates whether a port-based VLAN is configured as a voice VLAN. See Using voice VLANs.
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.
Displaying VLAN listing with GVRP enabled
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.
HP 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
Syntax:
Displays VLAN information for an individual port or a group of ports, either cumulatively or on a detailed per-port basis.
Specifies a single port number or a range of ports (for example,
a1-a16
) , orall
for which to display information.Displays detailed VLAN membership information on a per-port basis.
Descriptions of items displayed by the command are:
Displaying VLAN ports (cumulative listing)
HP 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)
HP 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
Syntax:
Uses the VID to identify and display the data for a specific static or dynamic VLAN.
The default or specified name assigned to the VLAN. For a static VLAN, the default name consists of
VLAN-x
wherex
matches the VID assigned to that VLAN. For a dynamic VLAN, the name consists ofGVRP_x
wherex
matches the applicable VID.
Port-Based, temporary VLAN learned through GVRP. See GVRP.
Indicates whether a port-based VLAN is configured as a voice VLAN. See Using voice VLANs.
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.
Shows whether a port is a tagged or untagged member of the listed 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.
Displaying information for a specific static VLAN
HP 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.
HP 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
Syntax
Specifies the order you want information to display for the
show vlans
command. Displays information for one port or a range of ports. Ifis not specified, all ports display.
<port-list>
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.
HP 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.
HP Switch(config)#: show vlan custom id Status and Counters - VLAN Information - Custom view VLANID ------ 1 33 44 HP Switch(config)#: show vlan custom id:2 Status and Counters - VLAN Information - Custom view VL -- 1 33 44
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:
HP Switch(config)#: show vlans custom 1-3 name vlun include vlan1
HP recommends that you try the show vlans custom
command first to ensure there is output and then enter the command again with the pattern matching option.
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
HP Switch(config)#: alias showvlanstatus = “show vlan custom A1-A3 id name:20 status” HP 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