The port default vlan command configures the default VLAN of an interface and adds the interface to the VLAN.
The undo port default vlan command restores the default VLAN of an interface to the default setting.
By default, VLAN 1 is the default VLAN of all interfaces.
port default vlan vlan-id [ step step-number [ increased | decreased ] ]
undo port default vlan
Parameter |
Description |
Value |
---|---|---|
vlan-id |
Specifies the ID of the default VLAN. |
The value is an integer that ranges from 1 to 4094. |
step step-number [ increased | decreased ] | Specifies that the interface added to an interface group can be bound to VLANs starting from the one identified by vlan-id in an ascending or descending order at a step specified by step-number. increased specifies an increase in the values of VLAN IDs starting from the one identified by vlan-id at a step specified by step-number to add the interfaces to the VLANs. Whereas decreased specifies a decrease in the values of VLAN IDs starting from the one identified by vlan-id at a step specified by step-number to add the interfaces to the VLANs. For example, you can configure increased, and set vlan-id to 10 and step-number to 20 in the port default vlan command. After this configuration, interface 1 joins VLAN 10; interface 2 joins VLAN 30... By analogy, interface 10 joins VLAN 190. NOTE:
|
The value is an integer that ranges from 1 to 4093. |
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view, 40GE interface view, 100GE interface view, MultiGE interface view, VE interface view, Eth-Trunk interface view, port group view
Usage Scenario
All frames sent from a user device are untagged, and frames sent from a remote device may also be untagged. However, the device processes only tagged frames. Therefore, the device adds a tag to each untagged frame received by an interface. The default VLAN ID of the interface can be added to untagged frames so that these frames are forwarded in the default VLAN.
Prerequisites
The interface type is negotiation-desirable, negotiation-auto, access or QinQ. If not, run the port link-type command to change the interface type. The interface where negotiation-desirable or negotiation-auto is configured must be negotiated as an access interface so that the default VLAN configured by the port default vlan command takes effect.
Precautions
If the ID of a nonexistent VLAN is configured as the PVID, VLAN 1 is added to the untagged packets. After the PVID is configured globally, the PVID of the interface is changed to the configured one.