< Home

port link-type

Function

The port link-type command sets the link type of an interface.

The undo port link-type command restores the default link type of an interface.

By default, the link type of an interface on the S2720-EI, S5720I-SI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI is negotiation-auto, and the link type of an interface on other models is negotiation-desirable.

Only the S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S support VE interfaces. You can configure the link type for a VE interface only after the VE interface is switched to Layer 2 mode using the portswitch command. The default link type is hybrid.

Format

port link-type { access | dot1q-tunnel | hybrid | trunk | negotiation-desirable | negotiation-auto }

undo port link-type

Parameters

Parameter

Description

Value

access

Sets the link type of an interface to access.

-

dot1q-tunnel

Sets the link type of an interface to QinQ.

-

hybrid

Sets the link type of an interface to hybrid.

-

trunk

Sets the link type of an interface to trunk.

-

negotiation-desirable

Sets LNP negotiation mode for a Layer 2 Ethernet interface to negotiation-desirable.

NOTE:

This parameter is not supported in the VE interface view.

-

negotiation-auto

Sets the LNP negotiation mode for a Layer 2 Ethernet interface to negotiation-auto.

NOTE:

This parameter is not supported in the VE interface view.

-

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

Access, hybrid, trunk, and dot1q-tunnel link types are statically configured, and the LNP negotiation mode of negotiation-desirable or negotiation-auto is dynamically negotiated. The interface where negotiation-desirable or negotiation-auto is configured is negotiated as the access or trunk interface.

Characteristics of different interfaces are:
  • An access interface connects to a user device. It can connect only to an access link, and Ethernet frames transmitted on the access link are untagged. If the default VLAN is configured for an access interface, the interface adds a VLAN tag to packets and sets the VID field in the VLAN tag to the default VLAN ID. The access link transmits only the packets with the default VLAN ID.
  • A trunk interface connects to a switch and can connect only to a trunk link. A trunk interface allows frames from multiple VLANs to pass.
  • A hybrid interface can connect to either a user device or a switch, and it can connect to an access link or a trunk link. A hybrid interface allows frames from multiple VLANs to pass and can remove VLAN tags of outgoing frames.
  • A QinQ interface connects to a switch and can process double-tagged frames.
  • The interface configured with negotiation-desirable can actively send negotiation packets, while the interface configured with negotiation-auto cannot actively send negotiation packets. The interface where negotiation-desirable or negotiation-auto is configured is negotiated as the access or trunk interface through LNP and added to a VLAN. Table 1 describes the negotiation result when the local and remote ends use different negotiation modes.
    Table 1 LNP negotiation

    Local LNP Negotiation Mode

    Remote Link Type or LNP Negotiation Mode

    Locally Negotiated Link Type

    Remotely Negotiated Link Type

    Link Type When Negotiation Fails

    negotiation-desirable/negotiation-auto

    Access (negotiate on)

    Access

    Access

    Access

    Hybrid (negotiate on)

    Trunk

    Hybrid

    Access

    Dot1q-tunnel (negotiate on)

    Access

    Dot1q-tunnel

    Access

    Trunk (negotiate on)

    Trunk

    Trunk

    Access

    LNP negotiation not supported or negotiate off

    Access

    N/A

    Access

    negotiation-desirable

    negotiation-desirable

    Trunk

    Trunk

    Access

    negotiation-desirable

    negotiation-desirable

    Trunk

    Trunk

    Access

    negotiation-auto

    negotiation-desirable

    Access

    Access

    Access

    negotiate on: LNP negotiation is enabled. negotiate off: LNP negotiation is disabled. N/A: The link type is uncertain.

Prerequisites

LNP has been enabled.

Follow-up Procedure

Add the interface to VLANs.

Precautions

This command is invalid on a member interface of an Eth-Trunk.

Starting from V200R005C00, the default link type of an interface is not hybrid. Before upgrading the device of an earlier version of V200R005C00 to V200R005C00 or later, the port link-type hybrid command configuration is generated.

If you run the port link-type command multiple times in the same interface view, only the latest configuration takes effect.

When using LNP negotiation, pay attention to the following points:
  • If a Layer 2 Ethernet interface is Down, it does not participate in LNP negotiation.
  • If the two ends of an Eth-Trunk link have different numbers of member interfaces, LNP negotiation may fail.

  • If the link type of the Layer 2 Ethernet interface is configured as access, hybrid, trunk, or dot1q-tunnel using the port link-type command, LNP does not take effect on the interface.
  • The interface configured with negotiation-desirable or negotiation-auto is negotiated as an access or trunk interface. By default, the negotiated access interface joins VLAN 1, and the negotiated trunk interface allows all VLANs and uses default VLAN 1. port default vlan and port trunk allow-pass only-vlan can be simultaneously used on the interface configured with negotiation-desirable or negotiation-auto. If the interface is negotiated as an access interface, port default vlan takes effect. If the interface is negotiated as a trunk interface, port trunk allow-pass only-vlan takes effect.

Before changing the link type of an interface, you do not need to restore the default VLAN configuration. However, if the link type of the interface is changed, the VLAN configuration of the interface is deleted. Exercise caution when you perform this configuration.

There are limitations on the interface where negotiation-desirable or negotiation-auto is configured:
  • The sub-interface cannot be created.
  • No MUX VLAN can be enabled.
  • No voice VLAN in auto mode can be configured.

Dot1q-tunnel interfaces do not support the voice VLAN function.

On the S5735-L, S5735S-L, S5735S-L-M, S5735-S, S5735-S-I, and S5735S-S, after the port link-type dot1q-tunnel command is run on an interface, IP packets cannot be forwarded on the interface.

If the device works in VBST mode, changing the link type of an interface may cause a loop on the network, resulting in a traffic storm. If the link type of an interface must be changed, disable the interfaces on both ends and then change the link type of these interfaces.

Example

# Set the link type of GE0/0/1 to trunk.

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