VLAN Configuration
Examples
Network requirements
Device A connects to Device B through the Trunk port Ethernet 1/0;
■
The default VLAN ID of the port is 100;
■
This port allows packets from VLAN 2, VLAN 6 to VLAN 50, and VLAN 100 to
■
pass through.
Network diagram
Figure 140 Network diagram for port-based VLAN configuration
Eth1/0
Device A
Configuration procedure
1 Configure Device A
# Create VLAN 2, VLAN 6 through VLAN 50, and VLAN 100.
<DeviceA> system-view
[DeviceA] vlan 2
[DeviceA-vlan2] quit
[DeviceA] vlan 100
[DeviceA-vlan100] vlan 6 to 50
Please wait... Done.
# Enter the Ethernet 1/0 interface view.
[DeviceA] interface Ethernet 1/0
# Configure Ethernet 1/0 as a Trunk port and configure its default VLAN ID as 100.
[DeviceA-Ethernet1/0] port link-type trunk
[DeviceA-Ethernet1/0] port trunk pvid vlan 100
# Configure Ethernet 1/0 to deny packets of VLAN 1 to pass. (All ports allow
packets of VLAN 1 to pass by default.)
[DeviceA-Ethernet1/0] undo port trunk permit vlan 1
# Configure Ethernet 1/0 to permit packets of VLAN 2, VLAN 6 through VLAN 50,
and VLAN 100.
[DeviceA-Ethernet1/0] port trunk permit vlan 2 6 to 50 100
Please wait... Done.
2 Configure Device B following similar steps as that of Device A.
Verification
Verifying the configuration of Device A is similar to that of Device B. so only Device
A is taken for example here.
# Display the information about Ethernet 1/0 of Device A to verify the above
configurations.
VLAN Configuration Examples
Eth1/0
Device B
495