If the switch has 24 ports, then it can have 24 separate networks on it. In most cases, Cisco switches support 1024 or more created VLANs per switch. Cisco's command structure for creating multiple networks and assigning them to ports is simple and straight forward.
What are VLANs anyway?
VLANs are simply a way of separating traffic logically rather than physically. Each data packet that the switch receives is labeled with a VLAN id that tells the switch which network that the packet belongs to. Sometimes the process is called "tagging" because of the VLAN id tag that is added to the data packet. The switchport access VLAN command demonstrated above tells the switch to remove the VLAN id before the data packet is forwarded onto the computer connected to that switch port.
First, create the VLANs.
switchA>en
switchA#configure terminal
switchA(config)#vlan 5
switchA(config-vlan)#description Accounting
switchA(config)#vlan 10
switchA(config-vlan)#description Marketing
This defines two separate networks on the switch that can by used for ports. VLAN 5 could be used for the Accounting department and VLAN 10 could be used for the Marketing department. After the ports are assigned to the correct VLAN, computers in the Accounting department will not be able to see the Marketing department. It will be as if each department had its own switch.
Configure the ports
switchA(config)#int fa0/1
switchA(config-if)#description Markg-1
switchA(config-if)#switchport mode acess
switchA(config-if)#switchport access vlan 5
switchA(config)#int fa0/2
switchA(config-if)#description Acctg-1
switchA(config-if)#switchport mode acess
switchA(config-if)#switchport access vlan 10
In some versions of the software, Cisco switches will allow the administrator to create VLAN assignments without first creating VLANs. If the VLAN is not properly created, the switch will discard the packets and the computers on that VLAN will not be able to communicate. The VLANs can be created after the ports are assigned.
Viewing VLAN information
Information on the switch's configured VLANs can be viewed in two ways. First with the show vlan command and second with the show interface command. If the
switchA>show vlan
VLAN Name Status Ports
---- -------------------------------- ---------
5 Accounting active fa0/1
10 Marketing active fa0/2
switchA>show interface status
Port Name Status Vlan Duplex Speed
fa0/1 Markg-1 connected 5 full 100
fa0/1 Acctg-1 inactive 10 full 100
VLAN 1 is default:
The default configuration for a Cisco switch is for every port to be on VLAN 1. Even when the the configuration does not show a switchport access vlan command on the port, it is assumed that the port is on VLAN 1. Once a port is assigned to a new VLAN, like the Accounting VLAN 5, it can no longer communicate directly with the other unconfigured ports.
Published by Jinx
IT guy by day View profile
- How to Become a Cisco Certified Network Associate (CCNA Routing and Switching)Detailed steps to become a Cisco Certified Network Associate, CCNA Routing and Switching.
- How Cisco Certification Can Assist in Your it Career GoalsOverview of Cisco Certifications and how they help in IT.
- Introduction to VoIP; A Few Tips for Those Considering VoIP DeploymentsThis primer is useful if you are new to VoIP or a network administrator who is deploying if for the first time (especially useful if deploying VoIP on WAN links slower than 768Kb).
- Configure Port Mirrors on Cisco Switches for Network AnalysisMirroring a switchport duplicates all of the traffic to another port for troubleshooting or analysis
- WLAN Plan for Acme Manufacturing Co.Acme Manufacturing Co. is growing and expanding its operations with the acquisition of a plant in China as well as several other offices throughout the United States.
- Configure VLAN Trunks on Cisco Switches
- Troubleshoot VLAN Trunks on Cisco Switches
- Overcoming the Limitations of Cisco SPAN with VACLs
- Configure Secondary IP Addresses on Cisco Routers
- Configuring Authentication for Cisco Routers and Switches
- Routers and Switches
- Deploying QoS on Cisco IOS Routers for WAN or Inter-VLAN QoS
