Changing the Link type of an interface - common VLAN operations

Latest reply: Jun 8, 2016 01:36:30 10024 1 0 0

This post is about changing the Link type of an interface - common VLAN operations. Please see more details below.


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.

a) When you enter y and press Enter, the device automatically deletes the non-default VLAN configuration of the interface and set the link type of the interface to the specified one.


b) 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.
<HUAWEI> system-view[HUAWEI] interface gigabitethernet0/0/1[HUAWEI-GigabitEthernet0/0/1] port link-type hybridWarning: 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.

a) Change the link type of the interface to access.


<HUAWEI> system-view[HUAWEI] interface gigabitethernet0/0/1[HUAWEI-GigabitEthernet0/0/1] port link-type access[HUAWEI-GigabitEthernet0/0/1] port default vlan 10 //Set the PVID of the interface to VLAN 10.

b) Change the link type of the interface to trunk.


<HUAWEI> system-view[HUAWEI] interface gigabitethernet0/0/1[HUAWEI-GigabitEthernet0/0/1] port link-type trunk[HUAWEI-GigabitEthernet0/0/1] port trunk pvid vlan 10 //Set the PVID of the interface to VLAN 10.
[HUAWEI-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 10 20 //Add the interface to VLAN 2, VLAN 10, and VLAN 20.

c) Change the link type of the interface to hybrid.


<HUAWEI> system-view[HUAWEI] interface gigabitethernet0/0/1[HUAWEI-GigabitEthernet0/0/1] port link-type hybrid[HUAWEI-GigabitEthernet0/0/1] port hybrid pvid vlan 10 //Set the PVID of the interface to VLAN 10.
[HUAWEI-GigabitEthernet0/0/1] port hybrid untagged vlan 2 10 //Add the interface to VLAN 2 and VLAN 10 in untagged mode.
[HUAWEI-GigabitEthernet0/0/1] port hybrid tagged vlan 20 //Add the interface to VLAN 20 in tagged mode.

d) Change the link type of the interface to Dot1q-tunnel.


<HUAWEI> system-view[HUAWEI] interface gigabitethernet0/0/1[HUAWEI-GigabitEthernet0/0/1] port link-type dot1q-tunnel[HUAWEI-GigabitEthernet0/0/1] port default vlan 10 //Set the PVID of the interface to VLAN 10. The interface adds VLAN 10 to all received data packets.

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.

<HUAWEI> system-view[HUAWEI] interface gigabitethernet0/0/1[HUAWEI-GigabitEthernet0/0/1] undo port default vlan

  • Restore the default VLAN configuration of a trunk interface.

<HUAWEI> system-view[HUAWEI] interface gigabitethernet0/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.

<HUAWEI> system-view[HUAWEI] interface gigabitethernet0/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


More information: S Series Switches Common Operation Guide.


  • x
  • convention:

user_1763575
Created Jun 8, 2016 01:36:30 Helpful(0) Helpful(0)

Thank you.
  • x
  • convention:

Comment

Reply
You need to log in to reply to the post Login | Register

Notice Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!
Login and enjoy all the member benefits

Login and enjoy all the member benefits

Login