R3303-HP HSR6800 Routers Layer 2 - LAN Switching Configuration Guide
95
To change the link type of a port from trunk to hybrid or from hybrid to trunk, you must set the link type
to access first.
After you configure the PVID for a hybrid port, you must use the port hybrid vlan command to configure
the hybrid port to allow packets from the PVID to pass through.
Port-based VLAN configuration example
Network requirements
As shown in Figure 36, Host A and Host C belong to Department A, and access the enterprise network
through different devices. Host B and Host D belong to Department B. They also access the enterprise
network through different devices.
To ensure communication security and avoid broadcast storms, VLANs are configured in the enterprise
network to isolate Layer 2 traffic of different departments. VLAN 100 is assigned to Department A, and
VLAN 200 is assigned to Department B.
Make sure hosts within the same VLAN can communicate with each other. Host A can communicate with
Host C, and Host B can communicate with Host D.
Figure 36 Network diagram
Configuration procedure
1. Configure Device A:
# Create VLAN 100, and assign port GigabitEthernet 4/0/1 to VLAN 100.
<RouterA> system-view
[RouterA] vlan 100
[RouterA-vlan100] port GigabitEthernet 4/0/1
[RouterA-vlan100] quit
# Create VLAN 200, and assign port GigabitEthernet 4/0/2 to VLAN 200.
[RouterA] vlan 200
[RouterA-vlan200] port GigabitEthernet 4/0/2
[RouterA-vlan200] quit
# Configure port GigabitEthernet 4/0/3 as a trunk port, and assign it to VLANs 100 and 200, to
enable GigabitEthernet 4/0/3 to forward traffic of VLANs 100 and 200 to Router B.
[RouterA] interface GigabitEthernet 4/0/3
[RouterA-GigabitEthernet4/0/3] port link-type trunk
[RouterA-GigabitEthernet4/0/3] port trunk permit vlan 100 200
Please wait... Done.
2. Configure Router B in the same way Router A is configured.