A VLAN is essentially a broadcast domain, assigned according to switch ports. By default, all ports on a Cisco 1900 are assigned to VLAN 1, sometimes referred to as the management or administrative VLAN. In order to implement additional VLANs, you will first need to define them, and then add ports to that VLAN. New VLANs are created from global configuration mode by using the vlan command and specifying both a VLAN number and name. For example, let’s say that we want to create a new VLAN for our Human Resources department (VLAN 100), and one for executives, VLAN 50.
Cisco1912#config t
Enter configuration commands, one per line. End with CNTL/Z
Cisco1912(config)#vlan 100 name HR
Cisco1912(config)#vlan 50 name Executives
To view all VLANs configured on a switch, use the show vlan command.
Cisco1912#show vlan
VLAN Name Status Ports
--------------------------------------
1 default Enabled 1-12, AUI, A, B
50 Executives Enabled
100 HR Enabled
1002 fddi-default Suspended
1003 token-ring-defau Suspended
1004 fddinet-default Suspended
1005 trnet-default Suspended
--------------------------------------
Notice that currently, all ports on our Catalyst 1912 switch are still part of VLAN 1. The next step involves adding ports to the newly configured VLAN. This is done from interface configuration mode, using the vlan-membership static command. In this case, we’ll add Ethernet ports 0/2 and 0/8 to VLAN 100.
Cisco1912#config t
Enter configuration commands, one per line. End with CNTL/Z
Cisco1912(config)#int e0/2
Cisco1912(config-if)#vlan-membership static 100
Cisco1912(config-if)#int e0/8
Cisco1912(config-if)#vlan-membership static 100
To confirm that the ports are now part of VLAN 100, use the show vlan command. An individual VLAN can be viewed by specifying the VLAN number after this command.
Cisco1912#show vlan
VLAN Name Status Ports
--------------------------------------
1 default Enabled 1, 3-7, 9-12, AUI, A, B
50 Executives Enabled
100 HR Enabled 2, 8
1002 fddi-default Suspended
1003 token-ring-defau Suspended
1004 fddinet-default Suspended
1005 trnet-default Suspended
--------------------------------------