< Home

port

Function

The port command configures a VLAN as the default VLAN of an interface and adds the interface to the VLAN.

The undo port 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 interface-type { interface-number1 [ to interface-number2 ] } &<1-10>

undo port interface-type { interface-number1 [ to interface-number2 ] } &<1-10>

Parameters

Parameter

Description

Value

interface-type { interface-number1 [ to interface-number2 ] }

Configures the default VLAN for multiple interfaces.
  • interface-type specifies the type of interfaces.
  • interface-number1 specifies the number of the first interface.
  • interface-number2 specifies the number of the last interface. The value of interface-number2 must be greater than the value of interface-number1. The interface-number1 and interface-number2 parameters identify a range of interfaces.

If to interface-number2 is not specified, only one interface is specified. You can specify 10 interface ranges at one time.

-

Views

VLAN 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 ID.
  • 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 packets; otherwise, the interface discards the packets.
    • 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 link-type of specified interfaces cannot be access or trunk before you run the port command.

Precautions

A super VLAN cannot be configured as the default VLAN of interfaces.

The undo port command deletes the default VLAN of the specified interfaces only if the current VLAN is the default VLAN of these interfaces.

If you run the port command multiple times in the same VLAN view, the VLAN is configured as the default VLAN of all the specified interfaces.

You can also run the port default vlan command in the interface view to configure the default VLAN for an interface. The two commands have the same function.

Example

# Configure VLAN 3 as the default VLAN of interfaces GE0/0/1 to GE0/0/4.
<HUAWEI> system-view
[HUAWEI] vlan 3
[HUAWEI-vlan3] port gigabitethernet 0/0/1 to 0/0/4
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >