VLAN Commands
Use these commands to configure VLAN settings.
switchport mode auto
M4250
M4350
This command globally enables the Auto-Trunk feature. If enabled, the switch can automatically configure a port as a trunk (that is, an Auto-Trunk) with an interconnected partner device that supports the Auto-Trunk feature.
After a port or an Auto-LAG becomes an Auto-Trunk, all VLANs on the switch become part of the trunk, allowing automatic configuration of all VLANs on the switch and partner device with which the trunk is established.
| Default | Enabled |
| Format | switchport mode auto |
| Mode | Global Config |
no switchport mode auto
This command globally disables the Auto-Trunk feature.
| Format | no switchport mode auto |
| Mode | Global Config |
show interfaces switchport trunk
M4250
M4350
This command displays information for all interfaces on which the Auto-Trunk feature is enabled. As an option, you can display the information for a single interface only.
To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument unit/slot/port, as shown in the command format.
| Format | show interfaces switchport trunk [unit/slot/port] |
| Mode | Privileged EXEC |
Command example:
(Switch)#show interfaces switchport trunk
Global Auto-Trunk Mode : Enabled
Intf PVID Allowed Vlans List Auto-Trunk
--------- ----- -------------------- ---------------
1/0/3 1 All Yes
1/0/15 1 All Yes
1/0/29 1 All Yes
Command example:
(Switch)#show interfaces switchport trunk 1/0/15
Global Auto-Trunk Mode : Enabled
Intf PVID Allowed Vlans List Auto-Trunk
--------- ----- -------------------- ---------------
1/0/15 1 All Yes
vlan database
M4250
M4350
This command gives you access to the VLAN Config mode (also referred to as VLAN Database mode), which allows you to configure VLAN characteristics.
| Format | vlan database |
| Mode | Privileged EXEC |
vlan
M4250
M4350
This command creates a new VLAN and assigns it an ID. The ID is a valid VLAN identification number (ID 1 is reserved for the default VLAN). The VLAN number is in the range 2–4093.
| Format | vlan number |
| Mode | Global Config |
no vlan
This command deletes an existing VLAN. The ID is a valid VLAN identification number (ID 1 is reserved for the default VLAN). The VLAN number is in the range 2–4093.
| Format | no vlan number |
| Mode | VLAN Config (also referred to as VLAN Database) |
vlan acceptframe
M4250
M4350
This command sets the frame acceptance mode on an interface or range of interfaces. For VLAN Only mode, untagged frames or priority frames received on this interface are discarded. For Admit All mode, untagged frames or priority frames received on this interface are accepted and assigned the value of the interface VLAN ID for this port. For admituntaggedonly mode, only untagged frames are accepted on this interface; tagged frames are discarded. With any option, VLAN tagged frames are forwarded in accordance with the IEEE 802.1Q VLAN Specification.
| Default | all |
| Format | vlan acceptframe {admituntaggedonly | vlanonly | all} |
| Mode | Interface Config |
no vlan acceptframe
This command resets the frame acceptance mode for the interface or range of interfaces to the default value.
| Format | no vlan acceptframe |
| Mode | Interface Config |
vlan ingressfilter
M4250
M4350
This command enables ingress filtering on an interface or range of interfaces. If ingress filtering is disabled, frames received with VLAN IDs that do not match the VLAN membership of the receiving interface are admitted and forwarded to ports that are members of that VLAN.
| Default | Disabled |
| Format | vlan ingressfilter |
| Mode | Interface Config |
no vlan ingressfilter
This command disables ingress filtering. If ingress filtering is disabled, frames received with VLAN IDs that do not match the VLAN membership of the receiving interface are admitted and forwarded to ports that are members of that VLAN.
| Format | no vlan ingressfilter |
| Mode | Interface Config |
vlan internal allocation
M4250
M4350
Use this command to configure which VLAN IDs to use for port-based routing interfaces. When a port-based routing interface is created, an unused VLAN ID is assigned internally.
| Format | vlan internal allocation {base vlan-id | policy ascending | policy descending} |
| Mode | Global Config |
| Parameter | Description |
|---|---|
| base vlan-id | The first VLAN ID to be assigned to a port-based routing interface. |
| policy ascending | VLAN IDs assigned to port-based routing interfaces start at the base and increase in value. |
| policy descending | VLAN IDs assigned to port-based routing interfaces start at the base and decrease in value. |
no vlan internal allocation
This command disables VLAN IDs that are used for port-based routing interfaces.
| Format | no vlan internal allocation {base | policy} |
| Mode | Interface Config |
vlan makestatic
M4250
M4350
This command changes a dynamically created VLAN (created by GVRP registration) to a static VLAN (one that is permanently configured and defined). The ID is a valid VLAN identification number. The VLAN number is in the range 2–4093.
| Format | vlan makestatic number |
| Mode | VLAN Config (also referred to as VLAN Database) |
vlan name
M4250
M4350
This command changes the name of a VLAN. The name is an alphanumeric string of up to 32 characters, and the number is a valid VLAN identification number. The number is in the range 1–4093.
| Default |
VLAN ID 1 - default other VLANS - blank string |
| Format | vlan name number name |
| Mode | VLAN Config (also referred to as VLAN Database) |
no vlan name
This command sets the name of a VLAN to a blank string.
| Format | no vlan name number |
| Mode | VLAN Config (also referred to as VLAN Database) |
vlan participation
M4250
M4350
This command configures the degree of participation for a specific interface or range of interfaces in a VLAN. The number is a valid VLAN identification number in the range 1-4093, and the interface is a valid interface number.
| Format | vlan participation {exclude | include | auto} number |
| Mode | Interface Config |
Participation options are:
| Options | Definition |
|---|---|
| include | The interface is always a member of this VLAN. This is equivalent to registration fixed. |
| exclude | The interface is never a member of this VLAN. This is equivalent to registration forbidden. |
| auto | The interface is dynamically registered in this VLAN by GVRP and will not participate in this VLAN unless a join request is received on this interface. This is equivalent to registration normal. |
no vlan participation include
This command removes the participation for a specific interface or range of interfaces in a VLAN.
| Format | no vlan participation include number |
| Mode | Interface Config |
vlan participation all
M4250
M4350
This command configures the degree of participation for all interfaces in a VLAN. The number is a valid VLAN identification number in the range 1–4093.
| Format | vlan participation all {exclude | include | auto} number |
| Mode | Global Config |
You can use the following participation options:
| Participation Options | Definition |
|---|---|
| include | The interface is always a member of this VLAN. This is equivalent to registration fixed. |
| exclude | The interface is never a member of this VLAN. This is equivalent to registration forbidden. |
| auto | The interface is dynamically registered in this VLAN by GVRP. The interface will not participate in this VLAN unless a join request is received on this interface. This is equivalent to registration normal. |
no vlan participation all include
This command removes the participation for all interfaces in a VLAN.
| Format | no vlan participation all include number |
| Mode | Global Config |
vlan port acceptframe all
M4250
M4350
This command sets the frame acceptance mode for all interfaces.
For the all mode, untagged frames or priority frames that enter on an interface are accepted and assigned the VLAN ID of the interface. With any of the three modes, VLAN-tagged frames are forwarded in accordance with the IEEE 802.1Q VLAN specification.
| Default | all |
| Format | vlan port acceptframe all {vlanonly | admituntaggedonly | all} |
| Mode | Global Config |
The modes are defined as follows:
| Mode | Definition |
|---|---|
| vlanonly | VLAN-only mode. Untagged frames or priority frames received on this interface are discarded. |
| admituntaggedonly | Admit untagged-only mode. VLAN-tagged and priority tagged frames received on this interface are discarded. |
| all | Admit all mode. Untagged frames or priority frames received on this interface are accepted and assigned the value of the interface VLAN ID for this port. |
no vlan port acceptframe all
This command sets the frame acceptance mode to the default mode all.
| Format | no vlan port acceptframe all |
| Mode | Global Config |
vlan port ingressfilter all
M4250
M4350
This command enables ingress filtering for all ports. If ingress filtering is disabled, frames received with VLAN IDs that do not match the VLAN membership of the receiving interface are admitted and forwarded to ports that are members of that VLAN.
| Default | Disabled |
| Format | vlan port ingressfilter all |
| Mode | Global Config |
no vlan port ingressfilter all
This command disables ingress filtering for all ports. If ingress filtering is disabled, frames received with VLAN IDs that do not match the VLAN membership of the receiving interface are admitted and forwarded to ports that are members of that VLAN.
| Format | no vlan port ingressfilter all |
| Mode | Global Config |
vlan port pvid all
M4250
M4350
This command changes the VLAN ID for all interfaces. The number is a valid VLAN identification number in the range 1–4093.
| Default | 1 |
| Format | vlan port pvid all number |
| Mode | Global Config |
no vlan port pvid all
This command sets the VLAN ID for all interfaces to 1.
| Format | no vlan port pvid all |
| Mode | Global Config |
vlan port tagging all
M4250
M4350
This command configures the tagging behavior for all interfaces in a VLAN to enabled. If tagging is enabled, traffic is transmitted as tagged frames. If tagging is disabled, traffic is transmitted as untagged frames. The number is a valid VLAN identification number in the range 1–4093.
| Format | vlan port tagging all number |
| Mode | Global Config |
no vlan port tagging all
This command configures the tagging behavior for all interfaces in a VLAN to disabled. If tagging is disabled, traffic is transmitted as untagged frames. The number is a valid VLAN identification number in the range 1–4093.
| Format | no vlan port tagging all number |
| Mode | Global Config |
vlan protocol group
M4250
M4350
This command adds a protocol-based VLAN group. The groupid is a unique number from 1–128 that is used to identify the group in subsequent commands.
| Format | vlan protocol group groupid |
| Mode | Global Config |
no vlan protocol group
This command removes a protocol-based VLAN group identified by groupid.
| Format | no vlan protocol group groupid |
| Mode | Global Config |
vlan protocol group name
M4250
M4350
This command assigns a name to a protocol-based VLAN group. The groupname variable can be a character string of 0 to 16 characters.
| Format | vlan protocol group name groupid groupname |
| Mode | Global Config |
no vlan protocol group name
This command removes the name from the group identified by groupid.
| Format | no vlan protocol group name groupid |
| Mode | Global Config |
vlan protocol group add protocol
M4250
M4350
This command adds the protocol to the protocol-based VLAN identified by groupid. A group may have more than one protocol associated with it. Each interface and protocol combination can only be associated with one group. If adding a protocol to a group causes any conflicts with interfaces currently associated with the group, this command fails and the protocol is not added to the group. The possible values for protocol-list include the keywords ip, arp, and ipx and hexadecimal or decimal values ranging from 0x0600 (1536) to 0xFFFF (65535). The protocol list can accept up to 16 protocols separated by a comma.
| Default | none |
| Format | vlan protocol group add protocol groupid ethertype protocol-list |
| Mode | Global Config |
no vlan protocol group add protocol
This command removes the protocols specified in the protocol-list from this protocol-based VLAN group that is identified by this groupid.
| Format | no vlan protocol group add protocol groupid ethertype protocol-list |
| Mode | Global Config |
protocol group
M4250
M4350
This command attaches a vlanid to the protocol-based VLAN identified by groupid. A group can only be associated with one VLAN at a time, however the VLAN association can be changed.
| Default | none |
| Format | protocol group groupid vlanid |
| Mode | VLAN Config (also referred to as VLAN Database) |
no protocol group
This command removes the vlanid from this protocol-based VLAN group that is identified by this groupid.
| Format | no protocol group groupid vlanid |
| Mode | VLAN Config (also referred to as VLAN Database) |
protocol vlan group
M4250
M4350
This command adds a physical interface or a range of interfaces to the protocol-based VLAN identified by groupid. You can associate multiple interfaces with a group, but you can only associate each interface and protocol combination with one group. If adding an interface to a group causes any conflicts with protocols currently associated with the group, this command fails and the interface or interfaces are not added to the group.
| Default | none |
| Format | protocol vlan group groupid |
| Mode | Interface Config |
no protocol vlan group
This command removes the interface from this protocol-based VLAN group that is identified by this groupid.
| Format | no protocol vlan group groupid |
| Mode | Interface Config |
protocol vlan group all
M4250
M4350
This command adds all physical interfaces to the protocol-based VLAN identified by groupid. You can associate multiple interfaces with a group, but you can only associate each interface and protocol combination with one group. If adding an interface to a group causes any conflicts with protocols currently associated with the group, this command will fail and the interface or interfaces are not added to the group.
| Default | none |
| Format | protocol vlan group all groupid |
| Mode | Global Config |
no protocol vlan group all
This command removes all interfaces from this protocol-based VLAN group that is identified by this groupid.
| Format | no protocol vlan group all groupid |
| Mode | Global Config |
show port protocol
M4250
M4350
This command displays the protocol-based VLAN information for either the entire system, or for the indicated group.
| Format | show port protocol {groupid | all} |
| Mode | Privileged EXEC |
| Term | Definition |
|---|---|
| Group Name | The group name of an entry in the Protocol-based VLAN table. |
| Group ID | The group identifier of the protocol group. |
| VLAN | The VLAN associated with this Protocol Group. |
| Protocol(s) | The type of protocol(s) for this group. |
| Interface(s) | Lists the interface(s) that are associated with this Protocol Group. |
vlan pvid
M4250
M4350
This command changes the VLAN ID on an interface or range of interfaces. The number is a valid VLAN identification number in the range 1–4093.
| Default | 1 |
| Format | vlan pvid number |
| Mode | Interface Config |
no vlan pvid
This command sets the VLAN ID on an interface or range of interfaces to 1.
| Format | no vlan pvid |
| Mode | Interface Config |
vlan tagging
M4250
M4350
This command configures the tagging behavior for a specific interface or range of interfaces in a VLAN to enabled. If tagging is enabled, traffic is transmitted as tagged frames. If tagging is disabled, traffic is transmitted as untagged frames. The number is a valid VLAN identification number in the range 1–4093.
| Format | vlan tagging number |
| Mode | Interface Config |
no vlan tagging
This command configures the tagging behavior for a specific interface or range of interfaces in a VLAN to disabled. If tagging is disabled, traffic is transmitted as untagged frames. The number is a valid VLAN identification number in the range 1–4093.
| Format | no vlan tagging number |
| Mode | Interface Config |
vlan association subnet
M4250
M4350
This command associates a VLAN to a specific IP-subnet.
| Format | vlan association subnet ipaddr netmask vlanid |
| Mode | VLAN Config (also referred to as VLAN Database) |
no vlan association subnet
This command removes association of a specific IP-subnet to a VLAN.
| Format | no vlan association subnet ipaddr netmask |
| Mode | VLAN Config (also referred to as VLAN Database) |
vlan association mac
M4250
M4350
This command associates a MAC address to a VLAN.
| Format | vlan association mac macaddr vlanid |
| Mode | VLAN Config (also referred to as VLAN Database) |
no vlan association mac
This command removes the association of a MAC address to a VLAN.
| Format | no vlan association mac macaddr |
| Mode | VLAN Config (also referred to as VLAN Database) |
remote-span
M4250
M4350
This command sets the VLAN as the RSPAN VLAN.
| Default | None |
| Format | remote-span |
| Mode | VLAN Config, accessible from Global Config mode through entering vlan vlan-id |
no remote-span
This command removes the RSPAN capability from the VLAN.
| Format | no remote-span |
| Mode | VLAN Config, accessible from Global Config mode through entering vlan vlan-id |
vlan association oui
M4250
M4350
This command assigns a VLAN to a port, based on the MAC OUI of the incoming packet. You can define an OUI-based VLAN by configuring a VLAN that corresponds to the MAC OUI so that the switch learns the MAC address in the L2-MAC table. If the OUI matches, the ingress port becomes a member of the OUI-based VLAN. The ingress port PVID is then set to the OUI-based VLAN. When the MAC entry expires, the ingress port is removed from the OUI-based VLAN.
| Format | vlan association oui oui-value vlan-id |
| Mode | VLAN Config |
Command example:
(NETGEAR Switch)# vlan association oui 00:01:02 9
no vlan association oui
M4250
M4350
This command deletes an OUI-based VLAN configuration.
| Format | no vlan association oui oui-value vlan-id |
| Mode | VLAN Config |
show vlan
M4250
M4350
This command displays information about the configured private VLANs, including primary and secondary VLAN IDs, type (community, isolated, or primary) and the ports which belong to a private VLAN.
| Format | show vlan {vlan-id | private-vlan [type]} |
| Mode |
Privileged EXEC User EXEC |
| Term | Definition |
|---|---|
| Primary | Primary VLAN identifier. The range of the VLAN ID is 1 to 4093. |
| Secondary | Secondary VLAN identifier. |
| Type | Secondary VLAN type (community, isolated, or primary). |
| Ports | Ports which are associated with a private VLAN. |
| VLAN ID | The VLAN identifier (VID) associated with each VLAN. The range of the VLAN ID is 1 to 4093. |
| VLAN Name | A string associated with this VLAN as a convenience. It can be up to 32 alphanumeric characters long, including blanks. The default is blank. VLAN ID 1 always has a name of Default. This field is optional. |
| VLAN Type | Type of VLAN, which can be Default (VLAN ID = 1) or static (one that is configured and permanently defined), or Dynamic. A dynamic VLAN can be created by GVRP registration or during the 802.1X authentication process (DOT1X) if a RADIUS-assigned VLAN does not exist on the switch. |
| Interface | unit/slot/port. It is possible to set the parameters for all ports by using the selectors on the top line. |
| Current |
The degree of participation of this port in this VLAN. The permissible values are:
|
| Configured |
The configured degree of participation of this port in this VLAN. The permissible values are:
|
| Tagging |
The tagging behavior for this port in this VLAN.
|
show vlan internal usage
M4250
M4350
This command displays information about the VLAN ID allocation on the switch.
| Format | show vlan internal usage |
| Mode |
Privileged EXEC User EXEC |
| Term | Definition |
|---|---|
| Base VLAN ID | Identifies the base VLAN ID for Internal allocation of VLANs to the routing interface. |
| Allocation policy | Identifies whether the system allocates VLAN IDs in ascending or descending order. |
show vlan port
M4250
M4350
This command displays VLAN port information.
To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument unit/slot/port, as shown in the command format.
| Format | show vlan port {unit/slot/port | all} |
| Mode |
Privileged EXEC User EXEC |
| Term | Definition |
|---|---|
| Interface | The selected interface. |
| Port VLAN ID Configured | The VLAN ID that this port will assign to untagged frames or priority tagged frames received on this port. The value must be for an existing VLAN. The factory default is 1. |
| Port VLAN ID Current | The VLAN ID that this port will assign to untagged frames or priority tagged frames received on this port. The value must be for an existing VLAN. The factory default is 1. |
| Acceptable Frame Types | The types of frames that may be received on this port. The options are 'VLAN only' and 'Admit All'. When set to 'VLAN only', untagged frames or priority tagged frames received on this port are discarded. When set to 'Admit All', untagged frames or priority tagged frames received on this port are accepted and assigned the value of the Port VLAN ID for this port. With either option, VLAN tagged frames are forwarded in accordance to the 802.1Q VLAN specification. |
| Ingress Filtering | May be enabled or disabled. When enabled, the frame is discarded if this port is not a member of the VLAN with which this frame is associated. In a tagged frame, the VLAN is identified by the VLAN ID in the tag. In an untagged frame, the VLAN is the Port VLAN ID specified for the port that received this frame. When disabled, all frames are forwarded in accordance with the 802.1Q VLAN bridge specification. The factory default is disabled. |
| GVRP | May be enabled or disabled. |
| Default Priority | The 802.1p priority assigned to tagged packets arriving on the port. |
show vlan association subnet
M4250
M4350
This command displays the VLAN associated with a specific configured IP-Address and net mask. If no IP address and net mask are specified, the VLAN associations of all the configured IP-subnets are displayed.
| Format | show vlan association subnet [ipaddr netmask] |
| Mode | Privileged EXEC |
| Term | Definition |
|---|---|
| IP Address | The IP address assigned to each interface. |
| Net Mask | The subnet mask. |
| VLAN ID | There is a VLAN Identifier (VID) associated with each VLAN. |
show vlan association mac
M4250
M4350
This command displays the VLAN associated with a specific configured MAC address. If no MAC address is specified, the VLAN associations of all the configured MAC addresses are displayed.
| Format | show vlan association mac [macaddr] |
| Mode | Privileged EXEC |
| Term | Definition |
|---|---|
| Mac Address | A MAC address for which the switch has forwarding and or filtering information. The format is 6 or 8 two-digit hexadecimal numbers that are separated by colons, for example 01:23:45:67:89:AB. In an IVL system the MAC address will be displayed as 8 bytes. |
| VLAN ID | There is a VLAN Identifier (VID) associated with each VLAN. |
show auto-vlan
M4250
M4350
This command displays information about the active Auto-VLAN sessions. To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument slot/port.
| Format | show auto-vlan interface {unit/slot/port | all} |
| Mode | Privileged EXEC |
show vlan association oui
M4250
M4350
This command displays summary information about OUI associations to a VLAN.
| Format | show vlan association oui |
| Mode |
Privileged EXEC User EXEC |
Command example:
(NETGEAR Switch)# show vlan association oui
Maximum OUI VLAN Entries................128
OUI VLAN Entries Currently in Use.......4
OUI VLAN ID
--------- --------
00:01:02 2
00:02:03 3
00:03:04 4
00:04:05 5