The port command sets a default VLAN for an interface and adds the interface to the VLAN.
The undo port command deletes the interface from the set default VLAN and restores the default VLAN of the interface to the default value.
port interface-type { interface-number1 [ to interface-number2 ] } &<1-10>
undo port interface-type { interface-number1 [ to interface-number2 ] } &<1-10>
| Parameter | Description | Value |
|---|---|---|
| interface-type { interface-number1 [ to interface-number2 ] } | Specifies a default VLAN interface, including:
In one port command, a maximum of 10 groups of ports can be specified by using to. |
The interface type can be: Ethernet interface, GE interface, and Eth-Trunk interface. |
Prerequisites
The port command can be run only when the Layer 2 interface type is Access.
When using the command, note the following:
The specified VLAN must be an existing one.
The ports to be added to VLANs must be Layer 2 ports. If you want to add Layer 3 ports to VLANs, you need to run the portswitch command to convert the Layer 3 ports to Layer 2 ports first.
Precautions
The VLAN ID of all interfaces is 1 by default.
When you specify the interface range, note that:
The types of the interfaces are the same.
The interfaces in the range must exist.