Issue Description
How Do I Change the Link Type of an Interface?
Solution
Four link types are defined: access, trunk, hybrid, and dot1q-tunnel. The following
provides the methods to set different link types.
1. Access
[Quidway-GigabitEthernet1/0/1] port link-type access
[Quidway-GigabitEthernet1/0/1] port default vlan 10
The preceding configuration changes the link type of the interface to access.
An access interface processes packets as follows:
When receiving an untagged packet, the interface accepts the packet and tags
it with the default VLAN ID.
When receiving a tagged packet:
If the VLAN ID of the packet is the same as the default VLAN ID of the interface,
the interface accepts the packet.
If the VLAN ID of the packet is different from the default VLAN ID of the interface,
the interface drops the packet.
Before sending a packet, the interface removes the VLAN tag from the packet.
2. Trunk
[Quidway-GigabitEthernet1/0/1] port link-type trunk
[Quidway-GigabitEthernet1/0/1] port trunk pvid vlan 20
[Quidway-GigabitEthernet1/0/1] port trunk allow-pass vlan 2 10 20
The preceding configuration changes the link type of the interface to trunk.
A trunk interface processes packets as follows:
- When receiving an untagged packet:
The interface tags the packet with the default VLAN ID. If the default
VLAN ID is in the list of allowed VLAN IDs, the interface accepts the packet.
The interface tags the packet with the default VLAN ID. If the default
VLAN ID is not in the list of allowed VLAN IDs, the interface drops the packet.
- When receiving a tagged packet:
If the VLAN ID of the packet is in the list of allowed VLAN IDs, the interface
accepts the packet.
If the VLAN ID of the packet is not in the list of allowed VLAN IDs, the interface
drops the packet.
- When sending a packet:
If the VLAN ID of the packet is the same as the default VLAN and is in the list of
allowed VLAN IDs, the interface removes the tag from the packet and sends the packet.
If the VLAN ID of the packet is different from the default VLAN and is in the list of
allowed VLAN IDs, the interface retains the tag and sends the packet.
3. Hybrid
[Quidway-GigabitEthernet1/0/1] port link-type hybrid
[Quidway-GigabitEthernet1/0/1] port hybrid pvid vlan 10
[Quidway-GigabitEthernet1/0/1] port hybrid untagged vlan 2 10
[Quidway-GigabitEthernet1/0/1] port hybrid tagged vlan 20
The preceding configuration changes the link type of the interface to hybrid.
A hybrid interface processes packets as follows:
- When receiving a tagged packet:
The interface tags the packet with the default VLAN ID. If the default VLAN ID is
in the list of allowed VLAN IDs, the interface accepts the packet.
The interface tags the packet with the default VLAN ID. If the default VLAN ID is
not in the list of allowed VLAN IDs, the interface drops the packet.
- When receiving a tagged packet:
If the VLAN ID of the packet is in the list of allowed VLAN IDs, the interface accepts
the packet.
If the VLAN ID of the packet is not in the list of allowed VLAN IDs, the interface drops
the packet.
- When sending a packet:
If the VLAN ID of the packet is in the list of allowed VLAN IDs, the interface sends the packet.
You can run the port hybrid untagged vlan command to configure the interface to remove tags
of packets or run the port hybrid tagged vlan command to configure the interface to send tagged packets.
4. Dot1q-tunnel
[Quidway-GigabitEthernet1/0/1] port link-type dot1q-tunnel
[Quidway-GigabitEthernet1/0/1] port default vlan 20
The preceding configuration changes the link type of the interface to dot1q-tunnel. A dot1q-tunnel
interface adds a VLAN tag to packets before forwarding them, regardless of the original VLAN IDs
of the packets. Before sending a packet, a dot1q-tunnel interface removes the tag with the default
VLAN ID from the packet.
Comments are closed