17 VLANs
17.4 Configuring port VLANs
17.4.1 List of configuration commands
The following table describes the commands used to configure port VLANs.
Table 17-7 List of configuration commands
Command name
switchport access
switchport mode
switchport trunk
vlan
17.4.2 Configuring a port VLAN
The following explains how to set a port VLAN. It provides example settings for Switch 1
shown in the figure below.
Port 0/1 is set for port VLAN 10. Ports 0/2 and 0/3 are set for port VLAN 20. Port 0/4 is the
trunk port, and all VLANs are set for it.
Figure 17-5 Example port VLAN settings
(1) Creating a port VLAN
Points to note
You can create a port VLAN. When a VLAN is created, if a VLAN ID is specified but
a VLAN type is not, the VLAN becomes a port VLAN.
Command examples
1.
(config)# vlan 10,20
(config-vlan)# exit
Creates VLAN ID 10 and VLAN ID 20 as port VLANs.
262
Description
Sets the access port VLAN.
Sets the port type (access or trunk).
Sets the VLAN for a trunk port.
Creates a port VLAN. Also, sets items pertaining to a VLAN in VLAN
configuration mode.