- Table of Contents
-
- H3C S3100 Series Ethernet Switches Command Manual (For Soliton)(V1.02)
- 00-1Cover
- 01-CLI Commands
- 02-Login Commands
- 03-Configuration File Management Commands
- 04-VLAN Commands
- 05-Management VLAN Commands
- 06-IP Address-IP Performance Commands
- 07-Voice VLAN Commands
- 08-GVRP Commands
- 09-Port Basic Configuration Commands
- 10-Link Aggregation Commands
- 11-Port Isolation Commands
- 12-Port Security-Port Binding Commands
- 13-DLDP Commands
- 14-MAC Address Table Management Commands
- 15-MSTP Commands
- 16-Multicast Commands
- 17-802.1x-System Guard Commands
- 18-AAA Commands
- 19-MAC Address Authentication Commands
- 20-ARP Commands
- 21-DHCP Commands
- 22-ACL Commands
- 23-QoS-QoS Profile Commands
- 24-Mirroring Commands
- 25-Stack-Cluster Commands
- 26-SNMP-RMON Commands
- 27-NTP Commands
- 28-SSH Commands
- 29-File System Management Commands
- 30-FTP-SFTP-TFTP Commands
- 31-Information Center Commands
- 32-System Maintenance and Debugging Commands
- 33-VLAN-VPN Commands
- 34-HWPing Commands
- 35-IPv6 Management Commands
- 36-DNS Commands
- 37-Smart Link-Monitor Link Commands
- 38-Appendix
- Related Documents
-
Title | Size | Download |
---|---|---|
04-VLAN Commands | 107.64 KB |
Table of Contents
Chapter 1 VLAN Configuration Commands
1.1 VLAN Configuration Commands
1.1.2 display interface Vlan-interface
1.1.4 interface Vlan-interface
1.2 Port-Based VLAN Configuration Commands
1.3 MAC-Based VLAN Configuration Commands
1.3.1 display mac-vlan interface
1.4 Protocol-Based VLAN Configuration Commands
1.4.1 display protocol-vlan interface
1.4.2 display protocol-vlan vlan
1.4.3 port hybrid protocol-vlan vlan
Chapter 1 VLAN Configuration Commands
1.1 VLAN Configuration Commands
1.1.1 description
Syntax
description text
undo description
View
VLAN view, VLAN interface view
Parameters
text: Case sensitive character string to describe the current VLAN or VLAN interface. Special characters and spaces are allowed.
It has:
l 1 to 32 characters for a VLAN description.
l 1 to 80 characters for a VLAN interface description.
Description
Use the description command to configure the description of the current VLAN or VLAN interface. You can use the description to provide information helping identify the devices or network segment attached to the VLAN or VLAN interface, and so on.
Use the undo description command to restore the default.
By default, the description of a VLAN is its VLAN ID, for example VLAN 0001; the description of a VLAN interface is its name, for example Vlan-interface 1 Interface.
You can display the description of a VLAN or VLAN interface with the display vlan or display interface Vlan-interface command.
Examples
# Configure the description of VLAN 10 as connect to LAB1.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] vlan 10
[Sysname-vlan10] description connect to LAB1
# Configure the description of VLAN-interface 10 as gateway of LAB1.
[Sysname-vlan10] quit
[Sysname] interface Vlan-interface 10
[Sysname-Vlan-interface10] description gateway of LAB1
1.1.2 display interface Vlan-interface
Syntax
display interface Vlan-interface [ vlan-id ]
View
Any view
Parameters
vlan-id: Specifies a VLAN interface number.
Description
Use the display interface Vlan-interface command to display information about the specified VLAN interface or all VLAN interfaces already created if no VLAN interface is specified.
The output of this command shows the state, IP address, description and other information of a VLAN interface. You can use the information to troubleshoot network problems.
Related commands: interface Vlan-interface.
Examples
# Display information about VLAN-interface 1.
<Sysname> display interface Vlan-interface 1
Vlan-interface1 current state : DOWN
Line protocol current state : DOWN
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 000f-e20f-4101
Internet Address is 10.1.1.1/24 Primary
Description : Vlan-interface1 Interface
The Maximum Transmit Unit is 1500
Table 1-1 Description on the fields of the display interface Vlan-interface command
Field |
Description |
Vlan-interface1 current state |
The state of the VLAN interface, which can be one of the following: l Administratively DOWN: This VLAN interface has been manually disabled with the shutdown command. l DOWN: The administrative state of this VLAN interface is up, but its physical state is down. It indicates that the VLAN corresponding to this interface does not contain ports in up state (possibly because the lines have failed). l UP: The administrative and physical states of this VLAN interface are both up. |
Line protocol current state |
The link layer protocol state of the VLAN interface, which can be one of the following: l DOWN: The protocol state of this VLAN interface is down, usually because no IP address is configured. l UP: The protocol state of this VLAN interface is up. |
IP Sending Frames' Format is PKTFMT_ETHNT_2 |
Format of the frames sent from the VLAN interface. PKTFMT_ETHNT 2 indicates that this VLAN interface sends Ethernet II frames. Refer to the VLAN configuration part in the accompanied operation manual for information about frame formats. |
Hardware address |
MAC address corresponding to the VLAN interface |
Internet Address |
IP address corresponding to the VLAN interface |
10.1.1.1/24 Primary |
Primary IP address of this VLAN interface |
Description |
Description string of the VLAN interface |
The Maximum Transmit Unit |
Maximum transmission unit (MTU) |
& Note:
For information about how to configure an IP address for a VLAN interface, refer to the description on the ip address command in the IP Address and Performance Command part.
1.1.3 display vlan
Syntax
display vlan [ vlan-id1 [ to vlan-id2 ] | all | dynamic | static ]
View
Any view
Parameters
vlan-id1: Specifies the ID of a VLAN of which information is to be displayed, in the range of 1 to 4094.
to vlan-id2: In conjunction with vlan-id1, define a VLAN range to display information about all existing VLANs in the range. The vlan-id2 argument takes a value in the range of 1 to 4094, and must not be less than that of vlan-id1.
all: Displays information about all the VLANs.
dynamic: Displays the number of dynamic VLANs and the ID of each dynamic VLAN. Dynamic VLANs refer to VLANs that are generated through GVRP or those distributed by a RADIUS server.
static: Displays the number of static VLANs and the ID of each static VLAN. Static VLANs refer to VLANs manually created.
Description
Use the display vlan command to display information about VLANs. The output shows the ID, type, VLAN interface state and member ports of a VLAN.
If no keyword or argument is specified, the command displays the number of existing VLANs in the system and the ID of each VLAN.
Related commands: vlan.
Examples
# Display information about VLAN 1.
<Sysname> display vlan 1
VLAN ID: 1
VLAN Type: static
Route Interface: configured
IP Address: 192.168.0.39
Subnet Mask: 255.255.255.0
Description: VLAN 0001
Name: VLAN 0001
Tagged Ports:
Ethernet1/0/1
Untagged Ports:
Ethernet1/0/2
Table 1-2 Description on the fields of the display vlan command
Field |
Description |
VLAN ID |
VLAN ID. |
VLAN Type |
VLAN type (dynamic or static). |
Route Interface |
Indicates whether the VLAN interface of the VLAN is configured with an IP address for routing. |
IP Address |
Primary IP address of the VLAN interface (available only on a VLAN interface configured with an IP address). You can use the display interface vlan-interface command in any view or the display this command in VLAN interface view to display its secondary IP address(es), if any. |
Subnet Mask |
Subnet mask of the IP address of the VLAN interface. |
Description |
Description of the VLAN. |
Name |
VLAN name. |
Tagged Ports |
Ports out of which packets are sent tagged. |
Untagged Ports |
Ports out of which packets are sent untagged. |
1.1.4 interface Vlan-interface
Syntax
interface Vlan-interface vlan-id
undo interface Vlan-interface vlan-id
View
System view
Parameters
vlan-id: Specifies the ID of a VLAN interface, in the range of 1 to 4094.
Description
Use the interface Vlan-interface command to create the VLAN interface for a VLAN and enter VLAN interface view.
Use the undo interface Vlan-interface command to delete a VLAN interface.
You can create a VLAN interface only for an existing VLAN and must ensure that the ID of the VLAN interface is the same as the VLAN ID.
You can use the ip address command in VLAN interface view (refer to the IP Address and Performance Command part for the command description) to configure an IP address for this VLAN interface to enable it to route packets for the devices in the corresponding VLAN.
Related commands: display interface Vlan-interface.
& Note:
An S3100 series switch can be configured with a single VLAN interface only, and the VLAN must be the management VLAN. For details about the management VLAN, refer to the “Management VLAN Configuration” part of this manual.
Examples
# Create the VLAN interface for VLAN 1 and enter VLAN-interface 1 view.
System View: return to User View with Ctrl+Z.
[Sysname] interface Vlan-interface 1
[Sysname-Vlan-interface1]
1.1.5 name
Syntax
name text
undo name
View
VLAN view
Parameters
text: VLAN name, a description of 1 to 32 characters. It can contain special characters and spaces.
Description
Use the name command to assign a name to the current VLAN.
Use the undo name command to restore the default VLAN name.
When 802.1x or MAC address authentication is configured on the switch, a RADIUS server may be used to deploy VLANs (either named or numbered) on the ports that have passed authentication. If a named VLAN is deployed, you must use the name command to associate the VLAN name with the intended VLAN ID. The name of a VLAN must be unique among all VLANs.
By default, the name of a VLAN is its VLAN ID, VLAN 0001 for example.
Examples
# Specify the name of VLAN 2 as test vlan.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] vlan 2
[Sysname-vlan2] name test vlan
1.1.6 shutdown
Syntax
shutdown
undo shutdown
View
VLAN interface view
Parameters
None
Description
Use the shutdown command to administratively shut down the VLAN interface.
Use the undo shutdown command to bring up the VLAN interface.
By default, a VLAN interface is administratively enabled. In this case, the physical state of the VLAN interface is affected by that of the ports in the VLAN.
l When all the Ethernet ports in the VLAN are down, the VLAN interface of the VLAN is down, that is, disabled.
l When one or more Ethernet ports in the VLAN are up, the VLAN interface of the VLAN is up, that is, enabled.
If you shut down the VLAN interface manually, the administrative state of the VLAN interface will always be down, regardless of the state of the ports in the VLAN.
You can use the undo shutdown command to enable a VLAN interface when its related parameters and protocols are configured. When a VLAN interface fails, you can use the shutdown command to disable the interface, and then use the undo shutdown command to enable this interface again, which may restore the interface.
Enabling or disabling a VLAN interface does not influence the state of the Ethernet ports belonging to this VLAN.
Related commands: display interface Vlan-interface.
Examples
# Disable the VLAN-interface1.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface Vlan-interface 1
[Sysname-Vlan-interface1] shutdown
1.1.7 vlan
Syntax
vlan { vlan-id1 [ to vlan-id2 ] | all }
undo vlan { vlan-id1 [ to vlan-id2 ] | all }
View
System view
Parameters
vlan-id1: Specifies the ID of the VLAN you want to create or remove, in the range of 1 to 4094.
to vlan-id2: In conjunction with vlan-id1, specify a VLAN ID range you want to create or remove. The vlan-id2 argument takes a value in the range of 1 to 4094, and must not be less than that of vlan-id1.
all: Creates or removes all existing VLANs except those configured with other functions.
Description
Use the vlan command to create VLANs. If you create only one VLAN, you enter the view of the VLAN upon its creation; if the specified VLAN already exists, you enter its VLAN view directly.
Use the undo vlan command to remove VLANs.
By default, only VLAN 1 exists in the system.
Caution:
l VLAN 1 is the default VLAN and cannot be removed.
l You cannot use the undo vlan command to directly remove the VLANs reserved by the protocol, voice VLAN, control VLANs for Smart Link, probe VLANs for remote mirroring, or VLANs used for performing any other features. To remove them, you must remove the associations of them with the features.
l After you use the undo vlan command to remove a VLAN functioning as the default VLAN of a trunk or a hybrid port, the configuration of the default VLAN on the trunk port or hybrid port does not change. The port will continue to use the removed VLAN as its default VLAN.
Examples
# Create VLAN 5 and enter its VLAN view.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] vlan 5
[Sysname-vlan5]
# Remove VLAN 5.
[Sysname-vlan5] quit
[Sysname] undo vlan 5
# Create VLAN 4 through VLAN 100.
[Sysname] vlan 4 to 100
Please wait............. Done.
# Remove VLAN 2 through VLAN 9 in bulk. VLAN 7 is the voice VLAN.
[Sysname] undo vlan 2 to 9
Note:The VLAN kept by protocol, the voice VLAN, the default VLAN, the management VLAN and the remote probe VLAN will not be deleted!
Please wait... Done.
[Sysname] display vlan
The following VLANs exist:
1(default), 7
The above output information indicates that VLAN 7 (the voice VLAN) cannot be removed, while the other VLANs are removed successfully.
1.2 Port-Based VLAN Configuration Commands
1.2.1 display port
Syntax
display port { hybrid | trunk }
View
Any view
Parameters
hybrid: Displays hybrid ports.
trunk: Displays trunk ports.
Description
Use the display port command to display the existing hybrid or trunk ports, if any.
For information about port type configuration, refer to the port link-type command.
Examples
# Display the existing hybrid ports.
<Sysname> display port hybrid
The following hybrid ports exist:
Ethernet1/0/1 Ethernet1/0/2
The above information shows the current system has two hybrid ports: Ethernet 1/0/1 and Ethernet 1/0/2.
1.2.2 port
Syntax
port interface-list
undo port interface-list
View
VLAN view
Parameters
interface-list: List of the Ethernet ports to be added to or removed from the current VLAN. In this list, you can specify individual ports and port ranges. An individual port takes the form of interface-type interface-number and a port range takes the form of interface-type interface-number1 to interface-type interface-number2, with interface-number2 taking a value no less than interface-number1. The total number of individual ports and port ranges defined in the list must not exceed 10.
Description
Use the port command to assign one or multiple access ports to the current VLAN.
Use the undo port command to remove the specified access port(s) from the current VLAN.
The command applies to access ports only. For information about how to assign to or remove from a VLAN trunk or hybrid ports, refer to the port hybrid vlan command and the port trunk permit vlan command. For port type configuration, refer to the port link-type command.
Related commands: display vlan.
Examples
# Assign Ethernet1/0/2 through Ethernet1/0/4 to VLAN 2.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] vlan 2
[Sysname-vlan2] port Ethernet 1/0/2 to Ethernet 1/0/4
1.2.3 port access vlan
Syntax
port access vlan vlan-id
undo port access vlan
View
Ethernet port view
Parameters
vlan-id: Specifies the ID of the VLAN to which you want to assign the current port, in the range of 1 to 4094. The specified VLAN must already exist.
Caution:
By default, all access ports belong to VLAN 1. You cannot assign an access port to or remove an access port from VLAN 1 with the port access vlan command or its undo form. To assign an access port that has been assigned to a VLAN other than VLAN 1, you can use the undo port access vlan command.
Description
Use the port access vlan command to assign the current access port to the specified VLAN.
Use the undo port access vlan command to remove the access port from the specified VLAN. After that, the access port joins VLAN 1 automatically.
Examples
# Assign Ethernet 1/0/1 to VLAN 3.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface ethernet 1/0/1
[Sysname-Ethernet1/0/1] port access vlan 3
1.2.4 port hybrid pvid vlan
Syntax
undo port hybrid pvid
View
Ethernet port view
Parameters
vlan-id: Specifies the default VLAN ID of the current hybrid port, in the range of 1 to 4094. The specified VLAN can be one already created or not.
Description
Use the port hybrid pvid vlan command to set the default VLAN ID of the hybrid port.
Use the undo port hybrid pvid command to restore the default VLAN ID of the hybrid port.
If the specified default VLAN has been removed or is not carried on the hybrid port, the port will be unable to receive VLAN untagged packets. You can configure a hybrid port to permit the packets of its default VLAN to pass through with the port hybrid vlan command.
Related commands: port link-type, port hybrid vlan.
Caution:
The local and remote hybrid ports must use the same default VLAN ID for the traffic of the default VLAN to be transmitted properly.
Examples
# Set the default VLAN ID of the hybrid port Ethernet 1/0/1 to 100.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface ethernet1/0/1
[Sysname-Ethernet1/0/1] port link-type hybrid
[Sysname-Ethernet1/0/1] port hybrid pvid vlan 100
1.2.5 port hybrid vlan
Syntax
port hybrid vlan vlan-id-list { tagged | untagged }
undo port hybrid vlan vlan-id-list
View
Ethernet port view
Parameters
vlan-id-list: List of the VLANs that the current hybrid port will be assigned to or removed from. In this list, you can specify individual VLAN IDs (each in the form of vlan-id) and VLAN ID ranges (each in the form of vlan-id1 to vlan-id2). Specify each VLAN ID in the range of 1 to 4094 and ensure that vlan-id2 is no less than vlan-id1. The total number of individual VLAN IDs and VLAN ID ranges defined in the list must not exceed 10. Be sure that the specified VLANs already exist.
tagged: Keeps VLAN tags when the packets of the specified VLANs are forwarded on the port.
untagged: Removes VLAN tags when the packets of the specified VLANs are forwarded on the port.
Description
Use the port hybrid vlan command to assign the hybrid port to one or multiple VLANs and configure the port to send packets tagged or untagged for the VLAN(s).
Use the undo port hybrid vlan command to remove the hybrid port from the specified VLAN(s).
By default, a hybrid port only allows packets from VLAN 1 to pass through untagged.
You can configure the port hybrid vlan vlan-id-list { tagged | untagged } command multiple times. The VLANs specified each time does not overwrite those configured before, if any.
The VLAN specified by the vlan-id argument must already exist. Otherwise, this command is invalid.
Related commands: port link-type.
Examples
# Assign hybrid port Ethernet 1/0/1 to VLAN 2, VLAN 4, and VLAN 50 through VLAN 100; configure the port to keep VLAN tags when sending the packets of these VLANs.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface ethernet 1/0/1
[Sysname-Ethernet1/0/1] port link-type hybrid
[Sysname-Ethernet1/0/1] port hybrid vlan 2 4 50 to 100 tagged
1.2.6 port link-type
Syntax
port link-type { access | hybrid | trunk }
undo port link-type
View
Ethernet port view
Parameters
access: Sets the link type of the current port to access.
hybrid: Sets the link type of the current port to hybrid.
trunk: Sets the link type of the current port to trunk.
Description
Use the port link-type command to set the link type of the Ethernet port.
Use the undo port link-type command to restore the default link type.
The default link type of an Ethernet port is access.
& Note:
To change the link type of a port from hybrid to trunk or vice versa, you need to change the link type to access first.
Examples
# Configure Ethernet 1/0/1 as a trunk port.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface ethernet 1/0/1
[Sysname-Ethernet1/0/1] port link-type trunk
1.2.7 port trunk permit vlan
Syntax
port trunk permit vlan { vlan-id-list | all }
undo port trunk permit vlan { vlan-id-list | all }
View
Ethernet port view
Parameters
vlan-id-list: List of the VLANs that the current trunk port will be assigned to or removed from. In this list, you can specify individual VLAN IDs (each in the form of vlan-id) and VLAN ID ranges (each in the form of vlan-id1 to vlan-id2). Specify each VLAN ID in the range of 1 to 4094 and ensure that vlan-id2 is no less than vlan-id1. The total number of individual VLAN IDs and VLAN ID ranges defined in the list must not exceed 10.
all: Assigns the trunk port to all VLANs. On a GVRP-enabled trunk port, you must configure the port trunk permit vlan all command to ensure that the traffic of all dynamically registered VLANs can pass through. However, When GVRP is disabled, you are discouraged to configure the keyword. This is to prevent users of unauthorized VLANs from accessing restricted resources through the port.
Description
Use the port trunk permit vlan command to assign the trunk port to the specified VLAN(s), that is, to allow packets from these VLANs to pass through the port.
Use the undo port trunk permit vlan command to remove the hybrid port from the specified VLAN(s).
By default, a trunk port belongs to VLAN 1 only.
On a trunk port, only traffic of the default VLAN can pass through untagged.
You can perform the command multiple times. The VLANs specified each time does not overwrite those configured before, if any.
Related commands: port link-type.
Examples
# Assign the trunk port Ethernet 1/0/1 to VLAN 2, VLAN 4, and VLAN 50 through VLAN 100.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface ethernet 1/0/1
[Sysname-Ethernet1/0/1] port link-type trunk
[Sysname-Ethernet1/0/1] port trunk permit vlan 2 4 50 to 100
Please wait... Done.
1.2.8 port trunk pvid vlan
Syntax
port trunk pvid vlan vlan-id
undo port trunk pvid
View
Ethernet port view
Parameters
vlan-id: Specifies the default VLAN ID of the current port, in the range of 1 to 4094.
Description
Use the port trunk pvid vlan command to set the default VLAN ID for the trunk port. A trunk port sends packets of the default VLAN untagged.
Use the undo port trunk pvid command to restore the default.
By default, the default VLAN ID of a trunk port is VLAN 1.
After configuring the default VLAN of a trunk port, you need to use the port trunk permit vlan command to configure the trunk port to allow the packets of the default VLAN to pass through.
If the specified default VLAN has been removed or is not carried on the trunk port, the port will be unable to receive VLAN untagged packets.
& Note:
The local and remote trunk ports must use the same default VLAN ID for the traffic of the default VLAN to be transmitted properly.
Related commands: port link-type, port trunk permit vlan.
Examples
# Set the default VLAN ID of the trunk port Ethernet 1/0/1 to 100.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface ethernet 1/0/1
[Sysname-Ethernet1/0/1] port link-type trunk
[Sysname-Ethernet1/0/1] port trunk pvid vlan 100
1.3 MAC-Based VLAN Configuration Commands
1.3.1 display mac-vlan interface
Syntax
display mac-vlan interface
View
Any view
Description
Use the display mac-vlan interface command to display all the ports with MAC-based VLAN enabled.
Related commands: mac-vlan enable.
Examples
# Display all the ports with MAC-based VLAN enabled.
<Sysname> display mac-vlan interface
MAC-VLAN is enabled on following ports:
---------------------------------------
Ethernet1/0/1 Ethernet1/0/2 Ethernet1/0/3
1.3.2 display mac-vlan
Syntax
display mac-vlan { all | dynamic | static | vlan vlan-id }
View
Any view
Parameters
all: Displays all the MAC-to-VLAN mappings.
dynamic: Displays dynamically created MAC-to-VLAN mappings.
static: Displays statically configured MAC-to-VLAN mappings.
vlan vlan-id: Specify the VLAN ID for which the MAC-to-VLAN mapping is to be displayed.
Description
Use the display mac-vlan command to display MAC-to-VLAN mappings.
Examples
# Display all the MAC-to-VLAN mappings.
<Sysname> display mac-vlan all
The following MAC-VLAN addresses exist:
S: Static D: Dynamic
MAC ADDR MASK VLAN ID PRIO STATE
-------------------------------------------------------------------
0002-0001-0000 ffff-ffff-ffff 5 3 S
Total MAC-VLAN address count:1
Table 1-3 Description on the fields of the display mac-vlan command
Field |
Description |
MAC ADDR |
MAC address in a MAC-to-VLAN mapping |
MASK |
Mask of the MAC address |
VLAN ID |
VLAN ID mapped to the MAC address |
PRIO |
802.1p priority assigned to the MAC address |
STATE |
The state of the MAC-to-VLAN mapping, which can be: l S, indicating that the MAC-to-VLAN mapping is configured statically. l D, indicating that the MAC-to-VLAN mapping is created automatically during authentication. l S&D, indicating that the MAC-to-VLAN mapping is created both statically and dynamically |
1.3.3 mac-vlan mac-address
Syntax
mac-vlan mac-address mac-addr vlan vlan-id [ priority priority ]
undo mac-vlan { all | mac-address mac-addr | vlan vlan-id }
View
System view
Parameters
mac-addr: Specifies a MAC address.
vlan vlan-id: Specify a VLAN ID, in the range of 1 to 4094.
priority priority: Specify an 802.1p priority for the MAC address, in the range of 0 to 7. The default is 0.
all: Removes all the static MAC-to-VLAN mappings.
Description
Use the mac-vlan mac-address command to map a MAC address to a VLAN and set its 802.1p priority.
Use the undo mac-vlan command to remove the mapping.
Examples
# Map MAC address 000f-e201-0001 to VLAN 100 and set its 802.1p priority to 7.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] mac-vlan mac-address 000f-e201-0001 vlan 100 priority 7
1.3.4 mac-vlan enable
Syntax
mac-vlan enable
undo mac-vlan enable
View
Ethernet port view
Parameters
None
Description
Use the mac-vlan enable command to enable MAC-based VLAN on the port.
Use the undo mac-vlan enable command to disable MAC-based VLAN on the port.
& Note:
l You cannot enable MAC-based VLAN on a link aggregation member port.
l You cannot enable MAC-based VLAN on a port configured with VLAN-VPN or selective QinQ.
By default, MAC-based VLAN is disabled.
Examples
# Enable MAC-based VLAN on GigabitEthernet 1/0/1.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface gigabitethernet 1/0/1
[Sysname–GigabitEthernet1/0/1] mac-vlan enable
1.4 Protocol-Based VLAN Configuration Commands
1.4.1 display protocol-vlan interface
Syntax
display protocol-vlan interface { interface-type interface-number [ to interface-type interface-number ] | all }
View
Any view
Parameters
interface-type interface-number: Specify a port by its type and number to display the protocol VLAN(s) bound with the port. You can use the interface-type interface-number to interface-type interface-number keyword and argument combination to specify a port range to display the protocol template information of the ports bound with protocol VLAN(s) in the range. When defining a port range, note that the second port must not be less than the first port.
all: Displays all the ports bound with at least one protocol VLAN and the associated protocol templates.
Description
Use the display protocol-vlan interface command to display information about protocol-based VLANs and protocol templates for the specified port(s).
Related commands: port hybrid protocol-vlan vlan, protocol-vlan.
Examples
# Display the protocol VLAN information of ports Ethernet1/0/1 and Ethernet1/0/2.
<Sysname> display protocol-vlan interface Ethernet 1/0/1 to Ethernet 1/0/2
Interface: Ethernet1/0/1
VLAN ID Protocol-Index Protocol-type
50 0 ip
80 1 ip
100 0 ip
100 1 ipx ethernetii
Interface: Ethernet1/0/2
VLAN ID Protocol-Index Protocol-type
80 2 at
Table 1-4 Description on the fields of the display vlan command
Field |
Description |
Interface |
Interface bound with at least one protocol VLAN |
VLAN ID |
ID of a protocol VLAN bound with the interface |
Protocol-Index |
Protocol template index |
Protocol-type |
Protocol type specified by the protocol template. Refer to the protocol-vlan command for detailed description. |
1.4.2 display protocol-vlan vlan
Syntax
display protocol-vlan vlan { vlan-id1 [ to vlan-id2 ] | all }
View
Any view
Parameters
vlan-id1: Specifies a VLAN ID in the range of 1 to 4094, of which the protocol VLAN configuration information is to be displayed.
to vlan-id2: In conjunction with vlan-id1, define a VLAN range to display the protocol template configurations of all protocol VLANs in the range. The vlan-id2 argument takes a value in the range of 1 to 4094, and must not be less than that of vlan-id1.
all: Displays all protocol VLANs and their protocol template information.
Description
Use the display protocol-vlan vlan command to display information about protocol VLANs.
Related commands: protocol-vlan.
Examples
# Display the protocol information and protocol indexes configured for VLAN 10 through VLAN 20.
<Sysname> display protocol-vlan vlan 10 to 20
VLAN ID: 10
VLAN Type: Protocol-based VLAN
Protocol-Index Protocol-Type
0 ip
1 ip
2 ipx ethernetii
3 at
VLAN ID: 15
VLAN Type: Protocol-based VLAN
Protocol-Index Protocol-Type
0 ip
Table 1-5 Description on the fields of the display protocol-vlan vlan command
Field |
Description |
VLAN ID |
Protocol VLAN ID |
VLAN Type |
VLAN type. Here, it refers to Protocol-based VLAN |
Protocol-Index |
Protocol template index |
Protocol-Type |
Protocol type specified in the protocol template. Refer to the protocol-vlan command for detailed description. |
1.4.3 port hybrid protocol-vlan vlan
Syntax
port hybrid protocol-vlan vlan vlan-id { protocol-index [ to protocol-index-end ] | all }
undo port hybrid protocol-vlan vlan vlan-id { protocol-index [ to protocol-index-end ] | all }
View
Ethernet port view
Parameters
vlan-id: Specifies the ID of the protocol VLAN bound with the port. The value range is 1 to 4094. At least one protocol template must have been configured for the VLAN.
protocol-index: Specifies a protocol template, in the range of 0 to 15.
to protocol-index-end: In conjunction with protocol-index, specify a protocol index range. The protocol-index-end argument takes a value in the range of 0 to 15 and must be greater than protocol-index.
all: Specifies all protocol indexes. With the all keyword, the port hybrid protocol-vlan vlan command binds the port with all the protocol templates of the specified protocol VLAN, and the undo form of the command removes the associations between the port and all the protocol templates of the specified protocol VLAN.
Description
Use the port hybrid protocol-vlan vlan command to bind the port with the specified protocol template(s) of a protocol VLAN.
Use the undo port hybrid protocol-vlan vlan command to remove the binding between the port and the specified protocol template(s) of a protocol VLAN.
& Note:
l The port hybrid protocol-vlan vlan command is available on hybrid ports only.
l Before you bind a port with a protocol VLAN, assign the port to the VLAN with the port hybrid vlan command. Otherwise, the binding will fail.
l To bind a protocol template to a port in a VLAN successfully, you must ensure that the protocol template has been created in the VLAN. If the protocol template you are binding with the port has not been created in the VLAN, the system will display the operation failure message. If some of the protocol templates you are binding with the port have not been created in the VLAN, the system does not display error messages while binding those already created with the port.
l When you removes the binding between a port and a protocol template, the system will report operation failure if the index of the specified protocol to be removed does not exist. If a part of the specified protocol indexes to be removed do not exist, the switch will remove the existing indexes when it prompts errors.
Related commands: display protocol-vlan interface.
Examples
# Bind Ethernet 1/0/1 with the protocols indexed from 0 to 2 of VLAN 3 (assuming that VLAN 3 is a protocol VLAN).
System View: return to User View with Ctrl+Z.
[Sysname] interface Ethernet 1/0/1
[Sysname-Ethernet1/0/1] port hybrid protocol-vlan vlan 3 0 to 2
# Remove the binding between Ethernet 1/0/1 and protocols indexed from 1 to 4 of VLAN 3.
[Sysname-Ethernet1/0/1] undo port hybrid protocol-vlan vlan 3 1 to 4
Protocol index 1 does not exist in VLAN 3
Protocol index 4 does not exist in VLAN 3
1.4.4 protocol-vlan
Syntax
protocol-vlan [ protocol-index ] { at | ip | ipx { ethernetii | llc | raw | snap } | mode { ethernetii etype etype-id | llc dsap dsap-id ssap ssap-id | snap etype etype-id } }
undo protocol-vlan { protocol-index [ to protocol-index-end ] | all }
View
VLAN view
Parameters
at: Creates the AppleTalk-based protocol template.
ip: Creates the IP-based protocol template.
ipx: Creates the IPX-based protocol template. The ethernetii, llc, raw and snap keywords represent four IPX encapsulation formats. For more information about encapsulation formats, refer to the accompanying operation manual.
mode: Configures a user-defined protocol template.
ethernetii etype-id: Creates the protocol template that matches the Ethernet II encapsulation format and the corresponding protocol type value of the packet. The etype-id argument indicates the protocol type value and ranges from 0x0600 to 0xFFFF(excluding 0x0800, 0x8137, and 0x809b).
llc: Creates the protocol template that matches LLC encapsulation format.
dsap-id: Destination service access point. This argument ranges 0x00 to 0xFF.
ssap-id: Source service access point. This argument ranges from 0x00 to 0xFF.
snap etype-id: Creates a protocol template that matches SNAP encapsulation format and the corresponding protocol type value of the packet. The etype-id argument indicates the protocol type value and ranges from 0x0600 to 0xFFFF.
protocol-index: Beginning protocol index ranging from 0 to 4. If you do not specify this argument, the beginning protocol index will be determined by the system.
protocol-index-end: End protocol index ranging from 0 to 4. Note that this argument must be larger than or equal to the protocol-index argument.
all: Deletes all the protocol templates.
& Note:
l At present, the S3100 series support only the standard templates of AppleTalk and IP, the standard template of IPX encapsulated in Ethernet II format, and the user-defined templates matching the Ethernet II encapsulation format. Protocol templates matching 802.2/802.3 encapsulation formats and their extended encapsulation formats are not supported on the S3100 series currently.
l When you use the mode keyword to configure a user-defined protocol template, if you set the etype-id argument for Ethernet II or SNAP packets to 0x0800, 0x8137, or 0x809B, the matching packets will have the same format as that of IP, IPX, and AppleTalk packets respectively. To prevent two commands from processing packets of the same matching conditions in different ways, the switch will prompt that you cannot set the etype-id argument for Ethernet II or SNAP packets to 0x0800, 0x8137, or 0x809B.
Description
Use the protocol-vlan command to configure the protocol template used for classifying protocol-based VLANs.
Use the undo protocol-vlan command to disable the configuration.
By default, no protocol template is configured.
Related commands: display protocol-vlan vlan.
Examples
# Configure VLAN 3 as a protocol-based VLAN and assign IP packets to VLAN 3 for transmission.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] vlan 3
[Sysname-vlan3] protocol-vlan ip
Caution:
Because the IP protocol is closely associated with the ARP protocol, you are recommended to configure the ARP protocol type when configuring the IP protocol type and associate the two protocol types with the same port, in case that ARP packets and IP packets are not assigned to the same VLAN, which will cause IP address resolution failure.
# Configure an ARP protocol template. The code for the ARP protocol is 0x0806.
[Sysname-vlan3] protocol-vlan mode ethernetii etype 0806