CONFIGURED FROM CONSOLE BY CONSOLSWITCH#SHOW VLAN BRIEFVLAN NAME STATUS PORTS—— ———————————————— ————- ———————————————-1 DEFAULT ACTIVE FA0/1, FA0/2, FA0/3, FA0/4FA0/5, FA0/6, FA0/7, FA0/8FA0/9, FA0/10, FA0/11, FA0/12FA0/13, FA0/14, FA0/15, FA0/16FA0/17,...

00:01:07: %SYS-5-CONFIG_I: Configured from console by consolSwitch#show vlan briefVLAN Name Status Ports—— ———————————————— ————- ———————————————-1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4Fa0/5, Fa0/6, Fa0/7, Fa0/8Fa0/9, Fa0/10, Fa0/11, Fa0/12Fa0/13, Fa0/14, Fa0/15, Fa0/16Fa0/17, Fa0/18, Fa0/19, Fa0/20Fa0/21, Fa0/22, Gi0/1, Gi0/210 VLAN0010 active20 VLAN0020 active1002 fddi-default act/unsup1003 token-ring-default act/unsup1004 fddinet-default act/unsup1005 trnet-default act/unsup

The next step is to assign ports to a VLAN.

Assigning Ports to a VLAN

After you have created the VLANs you plan to use, you need to manually assign them to a

port and place the port in access mode. To do this, use the switchport access and

switchport mode commands, as seen in Table 9-3.

Table 9-3 Port Assignment Commands

Key Topic

Command Action

switchport mode access Defines the VLAN membership mode for the port

switchport access vlan vlan-id Assigns the port to a VLAN

The steps to assign a port to a VLAN are as follows:

Step 1. Access global configuration mode using the configure terminal command.

Step 2. Access the interface using the interface command.

Step 3. Set the membership mode to access using the switchport mode access com-

mand.

Step 4. Assign a VLAN to the port using the switchport access vlan vlan-id com-

Step 5. Exit to privileged EXEC mode using the end command.

Step 6. You can verify your work using the show interface status and show interface

interface switchoprt commands.

In Figure 9-11, no ports will be made access ports, but if you needed to do this, your con-

figuration would resemble Example 9-2. Notice that you can use the show interface sta-

tus command to verify the VLAN assignment.

Example 9-2 Assigning a Port to a VLAN

Switch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/5Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#Switch#show interface status