How to change the link type of an interface

0

The link type of an interface can be access, trunk, hybrid, or Dot1q-tunnel. The methods used to change the link type of an interface in different versions are different.
In V200R005 and later versions, run the port link-type { access | trunk | hybrid | dot1q-tunnel } command and enter y or n as prompted. When the interface uses the default VLAN configuration, the system does not display any message. The link type of the interface is changed directly.
When you enter y and press Enter, the device automatically deletes the non-default VLAN configuration of the interface and sets the link type of the interface to the specified one.
When you enter n and press Enter, the device retains the current link type and VLAN configuration of the interface.
Change the link type of the interface to hybrid.
system-view
[HUAWEI] interface GigabitEthernet0/0/1
[HUAWEI-GigabitEthernet0/0/1] port link-type hybrid
Warning: This command will delete VLANs on this port. Continue?[Y/N]:y
Info: This operation may take a few seconds. Please wait for a moment...done. In earlier versions of V200R005, an interface joins VLAN 1 by default, and the PVID of an interface is VLAN 1. You can run the port link-type { access | trunk | hybrid | dot1q-tunnel } command to change the link type of the interface.
Change the link type of the interface to access.

system-view
[HUAWEI] interface GigabitEthernet0/0/1
[HUAWEI-GigabitEthernet0/0/1] port link-type access
[HUAWEI-GigabitEthernet0/0/1] port default vlan 10
Change the link type of the interface to trunk.

system-view
[HUAWEI] interface GigabitEthernet0/0/1
[HUAWEI-GigabitEthernet0/0/1] port link-type trunk
[HUAWEI-GigabitEthernet0/0/1] port trunk pvid vlan 10
[HUAWEI-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 10 20
Change the link type of the interface to hybrid.

system-view
[HUAWEI] interface GigabitEthernet0/0/1
[HUAWEI-GigabitEthernet0/0/1] port link-type hybrid
[HUAWEI-GigabitEthernet0/0/1] port hybrid pvid vlan 10
[HUAWEI-GigabitEthernet0/0/1] port hybrid untagged vlan 2 10
[HUAWEI-GigabitEthernet0/0/1] port hybrid tagged vlan 20
Change the link type of the interface to Dot1q-tunnel.

system-view
[HUAWEI] interface GigabitEthernet0/0/1
[HUAWEI-GigabitEthernet0/0/1] port link-type dot1q-tunnel
[HUAWEI-GigabitEthernet0/0/1] port default vlan 10
When you change the link type of an interface that does not use the default VLAN configuration, the system displays the message "Error: Please renew the default configurations."

You need to restore the default configuration of the interface, and then change the link type of the interface.

Restore the default VLAN configuration of an access or Dot1q-tunnel interface.
system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo port default vlan
Restore the default VLAN configuration of a trunk interface.
system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo port trunk pvid vlan
[HUAWEI-GigabitEthernet0/0/1] undo port trunk allow-pass vlan all
[HUAWEI-GigabitEthernet0/0/1] port trunk allow-pass vlan 1
Restore the default configuration of a hybrid interface.
system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo port hybrid pvid vlan
[HUAWEI-GigabitEthernet0/0/1] undo port hybrid vlan all
[HUAWEI-GigabitEthernet0/0/1] port hybrid untagged vlan 1

Other related questions:
Changing link types of interfaces on WLAN devices
You can change the type of an interface on a WLAN device as follows: - Change an access interface to a trunk or hybrid interface. [HUAWEI]interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1]undo port default vlan //Restore the default VLAN of the interface to VLAN 1. Run the display this command to check whether the interface has been added to other VLANs. If so, run the undo command delete the configurations. Change the interface type based on service requirements. [HUAWEI-GigabitEthernet0/0/1]port link-type hybrid // Set the interface type to hybrid. [HUAWEI-GigabitEthernet0/0/1]port link-type trunk //Set the interface type to trunk. - Change a trunk interface to an access interface or a hybrid interface. [HUAWEI]interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1]undo port trunk pvid vlan //Restore the default VLAN of the interface to VLAN 1. [HUAWEI-GigabitEthernet0/0/1]undo port trunk allow-pass vlan all //Deny packets from all VLANs. [HUAWEI-GigabitEthernet0/0/1]port trunk allow-pass vlan 1 //Allow packets from VLAN 1 to pass through. Run the display this command to check whether the interface has been added to other VLANs. If so, run the undo command delete the configurations. - Change the interface type based on service requirements. [HUAWEI-GigabitEthernet0/0/1]port link-type access //Set the interface type to access. [HUAWEI-GigabitEthernet0/0/1]port link-type hybrid //Set the interface type to hybrid. - Change a hybrid interface to a trunk interface or an access interface. [HUAWEI]interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1]undo port hybrid pvid vlan //Restore the default VLAN of the interface to VLAN 1. [HUAWEI-GigabitEthernet0/0/1]undo port hybrid vlan all //Deny packets from all VLANs. [HUAWEI-GigabitEthernet0/0/1]port hybrid untagged vlan 1 //Add the interface to VLAN 1 in untagged mode. Run the display this command to check whether the interface has been added to other VLANs. If so, run the undo command delete the configurations. Change the interface type based on service requirements. [HUAWEI-GigabitEthernet0/0/1]port link-type access //Set the interface type to access. [HUAWEI-GigabitEthernet0/0/1]port link-type trunk //Set the interface type to trunk. Note: The type of an interface can be successfully changed only when no VLAN configuration exists on the interface.

The link type of an interface cannot be changed from hybrid to access. How is this problem solved
Before using the port link-type command to change the link type of an interface, restore the default configuration of the interface. You can run the display this command in the interface view to view the interface configuration. Assume that the following configuration is used: # interface GigabitEthernet0/0/1 undo port hybrid vlan 1 port hybrid tagged vlan 10 #Run the port hybrid untagged vlan 1 and undo port hybrid tagged vlan 10 commands to restore the default configuration of the interface.

How to rapidly query the link types and default VLANs of all interfaces
Run the display port vlan command to check the link types and default VLANs of all interfaces. Example: V200R005 and later versions display port vlan Port Link Type PVID Trunk VLAN List ------------------------------------------------------------------------------- Eth-Trunk2 auto 1 1-4094 Eth-Trunk3 hybrid 1 - Eth-Trunk5 auto 1 1-4094 Ethernet0/0/1 auto 1 1-4094 Ethernet0/0/2 auto 1 1-4094 Ethernet0/0/3 auto 1 1-4094 Ethernet0/0/4 auto 1 1-4094 Ethernet0/0/5 auto 1 1-4094 Ethernet0/0/6 auto 0 - Ethernet0/0/7 auto 1 1-4094 Ethernet0/0/8 auto 0 - Ethernet0/0/9 auto 0 - Ethernet0/0/10 auto 1 1-4094 Ethernet0/0/11 auto 1 1-4094 Ethernet0/0/12 auto 0 - Ethernet0/0/13 auto 1 1-4094 Ethernet0/0/14 auto 1 1-4094 Ethernet0/0/15 auto 1 1-4094 Ethernet0/0/16 auto 1 1-4094 Ethernet0/0/17 auto 1 1-4094 Ethernet0/0/18 auto 1 1-4094 Ethernet0/0/19 auto 1 1-4094 Ethernet0/0/20 auto 1 1-4094 Ethernet0/0/21 access 20 - Ethernet0/0/22 auto 1 1-4094 Ethernet0/0/23 auto 1 1-4094 Ethernet0/0/24 access 4094 - GigabitEthernet0/0/1 auto 0 - GigabitEthernet0/0/2 auto 1 1-4094 GigabitEthernet0/0/3 auto 1 1-4094 GigabitEthernet0/0/4 auto 1 1-4094 Earlier versions of V200R005 (excluding V200R005) display port vlan Port Link Type PVID Trunk VLAN List ------------------------------------------------------------------------------- GigabitEthernet0/0/1 trunk 1 1 GigabitEthernet0/0/2 hybrid 1 - GigabitEthernet0/0/3 hybrid 1 - GigabitEthernet0/0/4 hybrid 1 - GigabitEthernet0/0/5 access 10 - GigabitEthernet0/0/6 hybrid 1 - GigabitEthernet0/0/7 hybrid 1 - GigabitEthernet0/0/8 hybrid 1 - GigabitEthernet0/0/9 hybrid 1 - GigabitEthernet0/0/10 hybrid 1 - GigabitEthernet0/0/11 hybrid 1 - GigabitEthernet0/0/12 hybrid 1 - GigabitEthernet0/0/13 hybrid 1 - GigabitEthernet0/0/15 hybrid 1 - GigabitEthernet0/0/16 hybrid 1 - GigabitEthernet0/0/17 hybrid 1 - GigabitEthernet0/0/18 hybrid 1 - GigabitEthernet0/0/19 hybrid 1 - GigabitEthernet0/0/20 hybrid 1 - GigabitEthernet0/0/21 hybrid 1 - GigabitEthernet0/0/22 hybrid 1 - GigabitEthernet0/0/23 hybrid 1 - GigabitEthernet0/0/24 hybrid 1 -The Link Type field indicates the link type of an interface, the PVID field indicates the default VLAN, and the Trunk VLAN List field indicates the list of VLANs allowed by a trunk interface. If the interface does not join any VLAN, the Trunk VLAN List field is displayed as -. If the link type of an interface is negotiation-desirable or negotiation-auto, the Trunk VLAN List field is displayed as 1 to 4094.

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top