< Home

port default vlan

Function

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.

Format

port default vlan vlan-id [ step step-number [ increased | decreased ] ]

undo port default vlan

Parameters

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:
  • This parameter can only be used in the port group view.

  • When using step and vlan-id in the command, ensure that all interfaces added to the VLAN are available.

  • If this parameter is not specified, all interfaces in an interface group are added into the same VLAN, that is, VLAN vlan-id.

The value is an integer that ranges from 1 to 4093.

Views

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

Default Level

2: Configuration level

Usage Guidelines

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.

After the default VLAN is specified for an access interface or a QinQ interface, packets passing through the interface are processed as follows:
  • When the interface receives an untagged frame, it tags the frame with the default VLAN tag.
  • When the interface receives a tagged packet:
    • If the interface is an access interface, it compares the VLAN ID of the packet with the default VLAN ID. If they are the same, the interface forwards the packet; otherwise, the interface discards the packet.
    • If the interface is a QinQ interface, it adds an outer tag with the default VLAN ID to the packet.
  • Before forwarding tagged packets, access and QinQ interfaces remove VLAN tags from the packets.

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.

  • You can also run the port command in the VLAN view to configure the default VLAN of an interface. The two commands have the same function.
  • A super VLAN cannot be configured as the default VLAN of interfaces.
  • This command is invalid on a member interface of an Eth-Trunk.
  • If you run the port default vlan command multiple times in the same interface view, only the latest configuration takes effect.

Example

# Configure VLAN 3 (an existing VLAN) as the default VLAN of GE0/0/1 (an access interface).

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port link-type access
[HUAWEI-GigabitEthernet0/0/1] port default vlan 3
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >