Command
Vlan
Use
This is the legacy way to configure VLANs on a switch. While this mode is being depreciated, you will still encounter it on older switches or routers with switch modules. On newer IOS releases, VLANs are configured in configure mode.
Syntax
Switch(vlan)#vlan
OR
Switch(vlan)#vlan
Example
In the below example we will enter the VLAN database, configure VLAN 55 and name it MANAGEMENT. First, we will verify that only the default VLANs are configured on the switch.
Copy
2950-XL#show vlan brief
VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4,
Fa0/5, Fa0/6, Fa0/7, Fa0/8,
Fa0/9, Fa0/10, Fa0/11, Fa0/12,
Fa0/13, Fa0/14, Fa0/15, Fa0/16,
Fa0/17, Fa0/18, Fa0/19, Fa0/20,
Fa0/21, Fa0/22, Fa0/23, Fa0/24
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Now we will create the vlan and name it. It is importent that when you create a vlan in the vlan database you either type apply or **exit.**If you don’t, then your changes will not be saved.
Copy
2950-XL#vlan database
2950-XL(vlan)#vlan 55 name MANAGEMENT
VLAN 55 added:
Name: MANAGEMENT
2950-XL(vlan)#exit
APPLY completed.
Exiting….
A show vlan brief confirms that vlan was created.
Copy
2950-XL#show vlan brief
VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4,
Fa0/5, Fa0/6, Fa0/7, Fa0/8,
Fa0/9, Fa0/10, Fa0/11, Fa0/12,
Fa0/13, Fa0/14, Fa0/15, Fa0/16,
Fa0/17, Fa0/18, Fa0/19, Fa0/20,
Fa0/21, Fa0/22, Fa0/23, Fa0/24
55 MANAGEMENT active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active