Virtual Lan
Virtual Lan
A VLAN allows a network administrator to create groups of logically networked devices that act as if they
are on their own independent network, even if they share a common infrastructure with other VLANs.
Using VLANs, you can logically segment switched networks based on functions, departments, or project
teams.
Benefits of a VLAN
User productivity and network adaptability are key drivers for business growth and success.
Implementing VLAN technology enables a network to more flexibly support business goals. The primary
benefits of using VLANs are as follows:
Security - Groups that have sensitive data are separated from the rest of the network,
decreasing the chances of confidential information breaches.
Cost reduction - Cost savings result from less need for expensive network upgrades and more
efficient use of existing bandwidth and uplinks.
Higher performance - Dividing flat Layer 2 networks into multiple logical workgroups (broadcast
domains) reduces unnecessary traffic on the network and boosts performance.
Etc…
1 – 1005
IDs 1002 through 1005 are reserved for Token Ring and FDDI VLANs.
IDs 1 and 1002 to 1005 are automatically created and cannot be removed.
Configurations are stored within a VLAN database file, called vlan.dat. The vlan.dat file is
located in the flash memory of the switch.
Use the following steps to configure and verify VLANs and Trunks on a switched network:
1. Create VLANs
2. Assign switch ports to VLANs statically.
3. Verify VLAN configuration.
4. Enable trunking on the inter-switch connections.
5. Verify trunk configuration.
Add a VLAN:
You will configure VLANs with IDs, when you configure normal range VLANs, the configuration details
are stored automatically in flash memory on the switch in a file called vlan.dat. Because you often
configure other aspects of a Cisco switch at the same time, it is good practice to save running
configuration changes to the startup configuration.
Example:
S1#configure terminal
S1(config)#vlan 20
S1(config-vlan)#name student
S1(config-vlan)#end
After you have created a VLAN, assign one or more ports to the VLAN. When you manually assign a
switch port to a VLAN, it is known as a static access port. A static access port can belong to only one
VLAN at a time.
Example:
S1#configure terminal
S1(config)#interface F0/18
S1(config-if)#switchport mode access
S1(config-if)#switchport access vlan 20
S1(config-if)#end
Verify VLANs and Port Memberships
After you configure the VLAN, you can validate the VLAN configurations using Cisco IOS show
commands.
EX:
There are a number of ways to manage VLANs and VLAN port memberships. The figure shows the syntax
for the no switchport access vlan command.
Ex:
To reassign a port to VLAN 1, you can use the no switchport access vlan command in interface
configuration mode. Examine the output in the show vlan brief command that immediately follows.
Notice how VLAN 20 is still active. It has only been removed from interface F0/18. In the show interfaces
f0/18 switchport command, you can see that the access VLAN for interface F0/18 has been reset to
VLAN 1.
A static access port can only have one VLAN. With Cisco IOS software, you do not need to first remove a
port from a VLAN to change its VLAN membership. When you reassign a static access port to an existing
VLAN, the VLAN is automatically removed from the previous port. In the example, port F0/11is
reassigned to VLAN 20 .
Delete VLANs
The figure provides an example of using the global configuration command no vlan vlan-id to remove
VLAN 20 from the system. The show vlan brief command verifies that VLAN 20 is no longer in the
vlan.dat file.
Alternatively, the entire vlan.dat file can be deleted using the command delete flash:vlan.dat from
privileged EXEC mode. After the switch is reloaded, the previously configured VLANs will no longer be
present. This effectively places the switch into is "factory default" concerning VLAN configurations.
Note: Before deleting a VLAN, be sure to first reassign all member ports to a different VLAN. Any ports
that are not moved to an active VLAN are unable to communicate with other stations after you delete
the VLAN.
Configure a Trunk
To configure a trunk on a switch port, use the switchport mode trunk command.
When you enter trunk mode, the interface changes to permanent trunking mode.
Ex:
S1#config t
S1(config)#interface fa0/1