Home > Articles > Cisco Certification > CCNA Routing and Switching > CCNA Self-Study (ICND Exam): Extending Switched Networks with Virtual LANs

CCNA Self-Study (ICND Exam): Extending Switched Networks with Virtual LANs

Chapter Description

Steve McQuerry discusses how VLANs operate to provide more effective networks by controlling broadcasts in your network.

VLAN Configuration

This section discusses the guidelines for configuring VLANs on the Catalyst switch. You will learn the steps to configure VLANs, how to enable VTP domains, how to define a trunk, how to create a VLAN, and how to verify proper VLAN operation.

You should remember several facts before you begin VLAN configuration:

  • The maximum number of VLANs that can operate on a switch is switch-dependent.

  • VLAN1 is one of the factory default VLANs.

  • Cisco Discovery Protocol (CDP) and VTP advertisements are sent on VLAN1.

  • The switch must be in VTP server mode or transparent mode to create, add, or delete VLANs.

VLAN Configuration Guidelines

The Catalyst switches have a factory default configuration in which various default VLANs are preconfigured. One of the default VLANs is VLAN1, which is used for CDP and VTP advertisements. The VLAN1 interface on a switch is also in the default VLAN1. As you'll recall, the switch requires an IP address for management purposes—for example, to allow Telnet connections into the switch, or to use the Visual Switch Manager (VSM) via an HTTP browser to configure the switch.

Before you can create a VLAN, the switch must be in VTP server mode or VTP transparent mode. If you want to propagate the VLAN to other switches in the domain, use server mode.

VLAN Configuration Steps

Before you create VLANs, you must decide whether to use VTP to maintain global VLAN configuration information for your network.

To allow VLANs to span multiple Catalyst switches on a single link, you must configure trunks to interconnect the switches.

By default, a switch is in VTP server mode so that VLANs can be added, changed, or deleted. If the switch is set to VTP client mode, VLANs cannot be added, changed, or deleted from that switch.

VLAN membership on the switch ports is assigned manually on a port-by-port basis. When you assign switch ports to VLANs using this method, it is known as port-based, or static, VLAN membership.

The following sections elaborate on the details of the steps to configure VLANs.

VTP Configuration Guidelines

The default VTP configuration parameters for the Catalyst switch are as follows:

  • VTP domain name: None

  • VTP mode: Server

  • VTP password: None

  • VTP pruning: Disabled

  • VTP trap: Disabled

The VTP domain name can be specified by the administrator or learned across a configured trunk line from a server with a domain name configured. By default, the domain name is not set.

By default, the switch is set to the VTP server mode.

A password can be set for the VTP management domain. The password entered must be the same for all switches in the domain. If you configure a VTP password, VTP does not function properly unless you assign the same password to each switch in the domain.

VTP pruning eligibility is one VLAN parameter advertised by the VTP protocol. Enabling or disabling VTP pruning on a VTP server propagates the change throughout the management domain. Enabling or disabling VTP pruning on a VTP server affects the entire management domain.

VTP trap is disabled by default. If you enable this feature, it causes an SNMP message to be generated every time a new VTP message is sent.

CAUTION

When adding a new switch to an existing domain, you should verify that the configuration revision number for the switch is 0 to prevent the new switch from propagating incorrect VLAN information. Example 3-1, in the "How VTP Works" section, demonstrated one method for resetting the VTP configuration revision number on the new switch.

Configuring VTP

Use the vtp global configuration command to specify the operating mode, domain name, password, generation of traps, and pruning capabilities of VTP. The syntax for this command is as follows:

switch(config)# vtp { [mode {server | transparent | client}] [domain domain-name]
 [password password] [pruning {enable | disable}]}

To verify a recent configuration change, or to just view the VTP configuration information, use the show vtp status privileged EXEC command, as demonstrated in Example 3-2. Also displayed is the IP address of the device that last modified the configuration and a time stamp showing when the modification was made. VTP has two versions:

  • VTP version 1 only supports Ethernet.

  • VTP version 2 supports Ethernet and Token Ring.

Example 3-2 show vtp status Output

Switch#show vtp status
VTP Version           : 2
Configuration Revision     : 5
Maximum VLANs supported locally : 250
Number of existing VLANs    : 10
VTP Operating Mode       : Server
VTP Domain Name         : switch_domain_1
VTP Pruning Mode        : Disabled
VTP V2 Mode           : Disabled
VTP Traps Generation      : Disabled
MD5 digest           : 0x1E 0xED 0x19 0x49 0x0F 0x37 0x65 0x64 
Configuration last modified by 192.168.255.21 at 3-1-93 00:02:39
Local updater ID is 192.168.255.21 on interface Vl1 (lowest numbered 
 VLAN interface found)

Trunk Line Configuration

Use the command switchport mode trunk at the interface configuration mode to set a port to trunk. On the Catalyst 2950, this enables 802.1Q trunking. On other Cisco IOS Software-based switches, such as the 3550, 4500, or 6500, you will need to choose an encapsulation method before you can enable trunking. The command switchport trunk encapsulation [isl | dot1q] chooses an encapsulation mode.

The Catalyst IOS switches also support Dynamic Trunking Protocol (DTP), which manages automatic trunk negotiation. The switchport mode command specifies a Layer 2 ports operation:

switch(config-if)# switchport mode [trunk | access | dynamic 
 [desirable | auto | nonegotiate]]

The options for the switchport mode command are as follows:

  • trunk—Configures the port to permanent trunk mode and negotiates with the connected device on the other side to convert the link to trunk mode. If multiple trunk encapsulations are available, the encapsulation must be chosen before this command will work.

  • access—Disables port trunk mode and negotiates with the connected device to convert the link to nontrunk. This port will belong to only the configured access VLAN.

  • dynamic desirable—Triggers the port to negotiate the link from nontrunk to trunk mode. The port negotiates to a trunk port if the connected device is in the trunk, dynamic desirable, or dynamic auto state. Otherwise, the port becomes a nontrunk port. This is the default for IOS switch ports

  • dynamic auto—Enables the port to become a trunk only if the connected device has the state set to trunk or dynamic desirable.

  • nonnegotiate—Configures the port to permanent trunk mode. No negotiation takes place with the partner. The other side must be trunk or nonegotiate for the trunk to work. You must also specify the encapsulation before choosing this mode.

Verifying Trunk Line Configuration

To verify a trunk configuration, use the command show interface switchport or show interface trunk privileged EXEC command. The syntax for the show interface switchport and privileged EXEC command is as follows:

switch(config)# show interface [type module/port] switchport

The syntax for the show interface trunk and privileged EXEC command is as follows:

switch(config)# show interface [type module/port] trunk

These commands display the trunk parameters, as demonstrated in Example 3-3.

Example 3-3show interface trunk and show interface switchport Output

Switch#show interface trunk

Port   Mode     Encapsulation Status    Native vlan
Fa0/1   on      802.1q     trunking   1
Gi0/1   on      802.1q     trunking   1

Port   Vlans allowed on trunk
Fa0/1   1-4094
Gi0/1   1-4094

Port   Vlans allowed and active in management domain
Fa0/1   1,101,202,303,404,505
Gi0/1   1,101,202,303,404,505

Port   Vlans in spanning tree forwarding state and not pruned
Fa0/1   1,101,202,303,404,505
Gi0/1   1,101,202,303,404,505

Switch#show interfaces fastEthernet 0/1 switchport 
Name: Fa0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative private-vlan host-association: none 
Administrative private-vlan mapping: none 
Operational private-vlan: none 
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001

Protected: false

Voice VLAN: none (Inactive)
Appliance trust: none

Adding a VLAN

Use the vlan global configuration command to configure a VLAN. The syntax for the vlan global configuration command is as follows:

Switch(config)#vlan number
Switch(config-vlan)#[name | mtu | shutdown | exit]

Each VLAN has a unique four-digit ID that can be a number from 0001 to 4096. To add a VLAN to the VLAN database, assign a number and name to the VLAN. After creating the VLAN, you will be in VLAN configuration mode. In this mode, use the name command to give the VLAN a name. VLAN1, VLAN1002, VLAN1003, VLAN1004, and VLAN1005 are the factory default VLANs. These VLANs exist on all Catalyst switches and are used as default VLANs for other topologies, such as Token Ring and FDDI. None of the default VLANs can be modified or deleted.

To add an Ethernet VLAN, you must specify at least a VLAN number. If no VLAN name is entered for the VLAN, the default is to append the VLAN number to the word VLAN. For example, VLAN0404 could be a default name for VLAN404 if no name is assigned.

Remember that to add, change, or delete VLANs, the switch must be in VTP server or transparent mode.

Verifying a VLAN/Modifying VLAN Parameters

When the VLAN is configured, the parameters for that VLAN should be confirmed to ensure validity. To verify the VLAN's parameters, use the show vlan id vlan# privileged EXEC command to display information about a particular VLAN. Use show vlan to show all configured VLANs.

The show vlan command output in Example 3-4 also shows which switch ports are assigned to the VLAN.

Example 3-4 show vlan Output

Switch#show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1  default                            active    Fa0/2, Fa0/3, Fa0/4, Fa0/6
                                                Fa0/7, Fa0/8, Fa0/9, Fa0/10
                                                Fa0/11, Fa0/12, Gi0/2
101 VLAN0101                          active  
202 VLAN0202                          active  
303 VLAN0303                          active  
404 VLAN0404                          active  
505 VLAN0505                          active  
986 VLAN0986                          active  
1002 fddi-default                     active  
1003 token-ring-default               active  
1004 fddinet-default                  active  
1005 trnet-default                    active  

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet 100001   1500     -      -      -        -    -        0      0  
101  enet 100101   1500     -      -      -        -    -        0      0  
202  enet 100202   1500     -      -      -        -    -        0      0  
303  enet 100303   1500     -      -      -        -    -        0      0  
     
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
404  enet  100404     1500  -      -      -        -    -        0      0  
505  enet  100505     1500  -      -      -        -    -        0      0  
986  enet  100986     1500  -      -      -        -    -        0      0  
1002 fddi  101002     1500  -      -      -        -    -        0      0  
1003 tr    101003     1500  -      -      -        -    -        0      0  
1004 fdnet 101004     1500  -      -      -        ieee -        0      0  
1005 trnet 101005     1500  -      -      -        ibm  -        0      0  

Remote SPAN VLANs
------------------------------------------------------------------------------


Primary Secondary Type       Ports
------- --------- ----------------- ------------------------------------------

Other VLAN parameters shown in Example 3-4 include the following:

  • Type (default is Ethernet)

  • Security Association ID (SAID), which is used for the FDDI trunk

  • Maximum transmission unit (MTU, where the default is 1500 for Ethernet VLAN)

  • Other parameters used for Token Ring or FDDI VLANs

To modify an existing VLAN parameter (such as the VLAN name), use the same command syntax used to add a VLAN.

In Example 3-5, the VLAN name for VLAN986 is changed to CSR_VLAN.

Example 3-5 Change VLAN Name

Switch# config t
Enter configuration commands, one per line. End with CNTL/Z
Switch(config)#vlan 986
Switch(config-vlan)#name CSR_VLAN

Use the show vlan id 986 command, as demonstrated in Example 3-6, to verify the change.

Example 3-6 Verify VLAN Change

Switch# show vlan id 986

VLAN Name               Status  Ports
---- -------------------------------- --------- -------------------------------
986 CSR_VLAN             active  Fa0/1, Gi0/1

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
986  enet  100986     1500  -      -      -        -    -        0      0  

Remote SPAN VLAN
----------------
Disabled

Primary Secondary Type       Ports
------- --------- ----------------- ------------------------------------------ 

Assigning Ports to a VLAN

After creating a VLAN, you can statically assign a port or a number of ports to that VLAN. A port can belong to only one VLAN at a time.

Configure the VLAN port assignment from the interface configuration mode using the interface command switchport access vlan number, as shown in the following syntax:

Switch(config-if)#switchport access vlan [1-4096 | dynamic]

dynamic means that the Catalyst switch queries a VMPS for VLAN information based on a MAC address. A number in the range of 1 to 4096 would represent the VLAN assignment for the port.

By default, all ports are members of the default VLAN—VLAN1.

Use the show vlan brief privileged EXEC command to display the VLAN assignment for all switch ports, as demonstrated in Example 3-7.

Example 3-7 Displaying VLAN Assignments and Membership for All Switch Ports

Switch#show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1  default                            active    Fa0/2, Fa0/3, Fa0/4, Fa0/6
                                                Fa0/7, Fa0/8, Fa0/9, Fa0/10
                                                Fa0/11, Fa0/12, Gi0/2
101 VLAN0101                          active  
202 VLAN0202                          active  
303 VLAN0303                          active  
404 VLAN0404                          active  
505 VLAN0505                          active  
986 CSR_VLAN                          active  
1002 fddi-default                     active  
1003 token-ring-default               active  
1004 fddinet-default                  active  
1005 trnet-default                    active  

Displaying Spanning Tree Protocol Configuration Status

Use the show spanning-tree privileged EXEC command to display the switch's Spanning Tree Protocol configuration status, as demonstrated in Example 3-8. The basic syntax for the show spanning-tree privileged EXEC command is as follows:

Switch# show spanning-tree [vlan number]

Example 3-8 show spanning-tree Output

Switch# show spanning-tree vlan 1
VLAN0001
 Spanning tree enabled protocol ieee
 Root ID  Priority  0
       Address   0005.00a9.2401
       Cost    8
       Port    13 (GigabitEthernet0/1)
       Hello Time  2 sec Max Age 20 sec Forward Delay 15 sec

 Bridge ID Priority  32769 (priority 32768 sys-id-ext 1)
       Address   000b.5f2a.5a40
       Hello Time  2 sec Max Age 20 sec Forward Delay 15 sec
       Aging Time 300

Interface    Port ID           Designated        Port ID
Name       Prio.Nbr   Cost Sts   Cost Bridge ID      Prio.Nbr
---------------- -------- --------- --- --------- -------------------- --------
Fa0/1      128.1     100 FWD     8 32769 000b.5f2a.5a40 128.1  
Gi0/1      128.13      4 FWD     4 32768 0005.3104.c000 32.65 

Example 3-8 displays various spanning tree information for VLAN1, including the following:

  • Port Fa0/1 and G0/1 are in the forwarding state for VLAN1.

  • The root bridge for VLAN1 has a bridge priority of 0 with a MAC address of 0005.00a9.2401.

  • The switch is running the IEEE 802.1D Spanning Tree Protocol.

Recall that a Catalyst switch can support a separate Spanning Tree instance per VLAN. This allows for load balancing between switches. For example, one switch can be the root for VLAN1, and another switch can be the root for VLAN2.

7. VLAN Command Summary | Next Section Previous Section

Cisco Press Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Cisco Press and its family of brands. I can unsubscribe at any time.

Overview

Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Cisco Press products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@ciscopress.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security

Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children

This site is not directed to children under the age of 13.

Marketing

Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out

Users can always make an informed choice as to whether they should proceed with certain services offered by Cisco Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.ciscopress.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links

This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020