7-5
To do…
Use the command…
Remarks
Assign the specified
access port or ports to
the current VLAN
port interface-list
Required
By default, all ports belong to VLAN 1.
Configuring the Default VLAN for a Port
Because an access port can belong to its default VLAN only, there is no need for you to configure the
default VLAN for an access port.
This section describes how to configure a default VLAN for a trunk or hybrid port.
Follow these steps to configure the default VLAN for a port:
To do…
Use the command…
Remarks
Enter system view
system-view
—
Enter Ethernet port view
interface interface-type
interface-number
—
Trunk port
port trunk pvid vlan vlan-id
Configure
the default
VLAN for the
port
Hybrid port
port hybrid pvid vlan vlan-id
Optional
VLAN 1 is the default
VLAN by default.
z
After configuring the default VLAN for a trunk or hybrid port, you need to use the
port trunk permit
command
or the
port hybrid vlan
command to configure the port to allow traffic of the default
VLAN to pass through. Otherwise, the port cannot forward traffic of the default VLAN, nor can it
receive VLAN untagged packets.
z
The local and remote trunk (or hybrid) ports must use the same default VLAN ID for the traffic of the
default VLAN to be transmitted properly.
Displaying and Maintaining Port-Based VLAN
To do…
Use the command…
Remarks
Display the hybrid or trunk ports
display port
{
hybrid
|
trunk
}
Available in any view.
Port-Based VLAN Configuration Example
Network requirements
z
As shown in
Figure 7-1
, Switch A and Switch B connect to PC 1/PC 2 and Server 1/Server 2 used
by different departments.
z
To isolate data between different departments, PC 1 and Server 1 are assigned to VLAN 100 with
the descriptive string being Dept1; PC 2 and Server 2 are assigned to VLAN 200 with the
descriptive string being Dept2.