1.1 VLAN
Configuration Commands
Syntax
description text
undo description
View
VLAN view, VLAN interface view
Parameter
text: String
to describe the current VLAN or VLAN interface.
l
In the range of 1 to 32 characters when
describing the current VLAN.
l
In the range of 1 to 80 characters when
describing the current VLAN interface.
Description
Use the description command to assign
a description string to the current VLAN or VLAN interface.
Use the undo description command to restore
the default description string.
By default, the description string of the
current VLAN is its VLAN ID, such as “VLAN 0001”; the description
string of the current VLAN interface is its name, such as “Vlan-interface
1 Interface”.
Related command: display vlan, and display
interface Vlan-interface.
Example
# Specify the description string of the
current VLAN as “RESEARCH”.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] vlan 1
[H3C-vlan1] description RESEARCH
Syntax
display interface
Vlan-interface [ vlan-id ]
View
Any view
Parameter
vlan-id:
ID of the specific VLAN interface.
Description
Use the display interface Vlan-interface
command to display the information about the VLAN interface, including:
l
Physical state and link state of the VLAN
interface
l
Format of the sent frames
l
MAC address, IP address and subnet mask of the
VLAN interface
l
Description string and MTU of the VLAN interface
If the vlan-id argument is
specified, the information about the specified VLAN interface is displayed; if
the vlan-id argument is not specified, the information about all the
created VLAN interfaces is displayed.
Related command: interface Vlan-interface.
Example
# Display the information about VLAN-interface2.
<H3C> display interface Vlan-interface
2
Vlan-interface2 current state : DOWN
Line protocol current state : DOWN
IP Sending Frames' Format is PKTFMT_ETHNT_2,
Hardware address is 00e0-fc07-4101
Internet Address is 10.1.1.1/24
Primary
Description : Vlan-interface2
Interface
The Maximum Transmit Unit is 1500
Table 1-1
Description on the fields of the display
interface Vlan-interface command
|
Field
|
Description
|
|
Vlan-interface2 current state
|
Current state of the VLAN interface
|
|
Line protocol current state
|
Current state of the Line protocol
|
|
IP Sending Frames' Format
|
Format of the frames that IP sends
|
|
Hardware address
|
MAC address corresponding to the VLAN
interface
|
|
Internet Address
|
IP address corresponding to the VLAN
interface
|
|
Description
|
Description
on the VLAN interface
|
|
The
Maximum Transmit Unit
|
Maximum
transmission unit (MTU)
|
Syntax
display vlan
[ vlan-id [ to vlan-id ] | all | dynamic | static
]
View
Any view
Parameter
vlan-id: VLAN
ID, in the range of 1 to 4094.
to:
Specifies multiple contiguous VLAN IDs.
all:
Displays the information about all the VLANs.
dynamic:
Displays the VLANs created dynamically.
static:
Displays the VLANs created statically.
Description
Use the display vlan command to display
the information about the specified VLANs or all VLANs.
If the vlan-id argument or
the all keyword is specified, the information about the specified VLANs
or the all VLANs is displayed, including:
l
VLAN ID
l
VLAN type (dynamic or static)
l
Whether the routing function is enabled (If yes,
the primary IP address and mask are displayed)
l
VLAN description
l
Member ports
If no argument/keyword is specified, this
command displays the amount and VLAN IDs of all the existing VLANs. If the dynamic
or static keyword is specified, this command displays the amount and
VLAN IDs of the VLANs that are created dynamically or statically.
Related command: vlan.
Example
# Display the information about VLAN 1.
<H3C> 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: none
Untagged Ports:
Ethernet1/0/1
Ethernet1/0/2 Ethernet1/0/3
Ethernet1/0/4
Ethernet1/0/5 Ethernet1/0/6
Ethernet1/0/7
Ethernet1/0/8 Ethernet1/0/9
Ethernet1/0/10
Ethernet1/0/11 Ethernet1/0/12
Ethernet1/0/13
Ethernet1/0/14 Ethernet1/0/15
Ethernet1/0/16
Ethernet1/0/17 Ethernet1/0/18
Ethernet1/0/19
Ethernet1/0/20 Ethernet1/0/21
Ethernet1/0/22
Ethernet1/0/23 Ethernet1/0/24
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
|
Whether the routing interface function is
enable for this VLAN
|
|
IP Address
|
IP address
|
|
Subnet Mask
|
Subnet mask
|
|
Description
|
Description on the VLAN
|
|
Name
|
VLAN name
|
|
Tagged Ports
|
Ports packets transmitted through which
are tagged
|
|
Untagged Ports
|
Port packets transmitted through which
are untagged
|
Syntax
interface Vlan-interface vlan-id
undo interface Vlan-interface vlan-id
View
System view
Parameter
vlan-id: ID of
the VLAN interface, in the range of 1 to 4,094.
Description
Use the interface Vlan-interface
command to create a VLAN interface or enter VLAN interface view.
Use the undo interface Vlan-interface
command to delete the VLAN interface.
Related command: display interface Vlan-interface.
Example
# Enter VLAN-interface1 view
<H3C>
system-view
System View: return to User View with
Ctrl+Z.
[H3C] interface Vlan-interface 1
[H3C-Vlan-interface1]
Syntax
name text
undo name
View
VLAN view
Parameter
text: String
that refers to the name of the current VLAN, in the range of 1 character to 32
characters. It can contain special characters and space.
Parameter
Use the name command to assign a
name to a VLAN.
Use the undo name command to restore
to the default VLAN name.
By default, the name of a VLAN is its VLAN
ID, such as “VLAN 0001”.
Example
# Specify the name of VLAN 2 as ”test
vlan”.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] vlan 2
[H3C-vlan2] name test vlan
Syntax
shutdown
undo shutdown
View
VLAN interface view
Parameter
None
Description
Use the shutdown command to disable the
VLAN interface.
Use the undo shutdown command to
enable the VLAN interface.
By default, the VLAN interface’s
management state is enabled. In this case, the physical state of the VLAN
interface is affected by the ports state in the VLAN. When all the Ethernet
ports of a VLAN are down, the VLAN interface of the VLAN is down, that is, the
VLAN interface is disabled; when one or more Ethernet ports of a VLAN are up,
the VLAN interface of the VLAN is up, that is, the VLAN interface is enabled.
If you disable the VLAN interface’s
management state, the VLAN interface will always be down, regardless of the
states 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.
The operation of enabling/disabling a VLAN
interface does not influence the Ethernet ports belonging to this VLAN.
Example
# Disable the VLAN-interface2.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] interface Vlan-interface 2
[H3C-Vlan-interface2] shutdown
Syntax
vlan vlan-id
undo vlan vlan-id
View
System view
Parameter
vlan-id: ID of
the VLAN which you want to create and whose view you want to enter. This
argument ranges from 1 to 4,094.
Description
Use the vlan command to enter VLAN
view. If the VLAN identified by the vlan-id argument does not exist, this
command creates the VLAN and then enters VLAN view.
Use the undo vlan command to remove a
VLAN.
Caution:
l
VLAN 1 is the default VLAN and cannot be
removed.
l
When you use the undo vlan command to remove a
VLAN which is the default VLAN of a trunk port or a hybrid port on the device,
the configuration of the default VLAN of the trunk port or hybrid port does not
change after the undo vlan command is executed, that is, the trunk port or the
hybrid port will use the removed VLAN (the already non-existing VLAN) as its
default VLAN.
Example
# Enter VLAN 1 view.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] vlan 1
[H3C-vlan1]
# Remove VLAN 5.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] undo vlan 5
Syntax
vlan { vlan-id1
to vlan-id2 | all }
undo vlan { vlan-id1
to vlan-id2 | all }
View
System view
Parameter
vlan-id1: ID
of the initial VLAN to be created, in the range of 1 to 4,094.
to:
Specifies the VLAN range.
vlan-id2: ID
of the terminal VLAN to be created, in the range of 1 to 4,094. The value of
the argument is no smaller than that of the vlan-id1 argument
all: Specifies
all VLANs.
Description
Use the vlan to command to create
multiple VLANs in batch.
Use the undo vlan to command to
remove multiple VLANs in batch.
Caution:
The undo vlan to
command or the undo vlan all command cannot be used to remove the VLANs
kept by the protocol, the Voice VLANs, the default VLANs (VLAN 1), the
management VLANs and the probe VLANs for remote mirroring.
Example
# Create VLAN 4 through VLAN 100.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] vlan 4 to 100
Please wait............. Done.
# Remove VLAN 2 through VLAN 9 in batch, in
which VLAN 5 is a Voice VLAN.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] undo vlan 2 to 9
Note:The VLAN kept by protocol, the
voice VLAN, the default VLAN, the manageme
nt VLAN and the remote probe VLAN
will not be deleted!
Please wait... Done.
[H3C] display vlan
The following VLANs exist:
1(default), 5
1.2 Port-Based
VLAN Configuration Commands
Syntax
port interface-list
undo port interface-list
View
VLAN view
Parameter
interface-list: List of Ethernet ports to be added to or removed from a VLAN. You
need to provide this argument in the form of interface-list = { interface-type
interface-number [ to interface-type interface-number ] } &<1-10>,
where:
l
interface-type is
port type and interface-number is port number.
l
The port number to the right of the to
keyword must be larger than or equal to the one to the left of the keyword.
l
&<1-10> means that you can provide up
to 10 ports or ports lists.
Parameter
Use the port command to add a port
or multiple ports to a VLAN.
Use the undo port command to remove a
port or multiple ports from a VLAN.
Caution:
The port command is only applicable to access ports. To add
trunk ports and hybrid ports to a VLAN, you can use the port trunk permit vlan
and port hybrid vlan commands in Ethernet port view. For the configuration
procedure, refer to the section “Port Basic Configuration” in H3C
S3100-52P Ethernet Switch Operation Manual.
Related command: display vlan.
Example
# Add Ethernet1/0/2 through Ethernet1/0/4 to
VLAN 2.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] vlan 2
[H3C-vlan2] port Ethernet 1/0/2 to Ethernet
1/0/4