Config Lab: VLAN Basics 3

Wendell Odom
By Wendell Odom September 3, 2021 09:05

Short and sweet – how do you create new VLANs and put a couple of ports in each? Today’s lab should be an easy and automatic process before you go take the CCNA exam, but getting one more rep in while you’re learning can help. So those of you in the early stages of learning switch commands and VLANs, take 5-10 and do this lab!

All about Config Labs

The blog has a series of lab exercises called “Config Labs.” Each lab presents a topology with the relevant initial configuration for each device. The lab also lists new requirements, after which you should create the additional configuration to meet those requirements. You can do the lab on paper, in a text editor, or use software tools like Cisco Packet Tracer or Cisco Modeling Labs.

Once you have created your answer, you can click various tabs at the bottom of this post to see the lab answers, comments about the lab, and other helpful information.

The Lab Exercise

Requirements

For this lab, we will place two of the GigabitEthernet ports on switch SW1 into VLAN 10 and two other GigabitEthernet ports into VLAN 20, creating two separate broadcast domains on the switch. VLAN 10 will be labeled “office,” and VLAN 20 will be labeled “research.”

VLANs help reduce CPU overhead on a switch by limiting the ports that receive a broadcast frame. They also enhance security by limiting traffic flow.

The specific rules for this lab are as follows:

  1. On Switch SW1, create VLAN 10 and name the VLAN “Office.” Create VLAN 20 and name the VLAN “Research.”
  2. Configure GigabitEthernet ports 1/0/1 and 1/0/2 into VLAN 10.
  3. Configure GigabitEthernet ports 1/0/3 and 1/0/4 into VLAN 20.

 

Figure 1: LAN Switch with Two VLANs

 

Initial Configuration

All ports are currently set to their default settings, other than the switch has a hostname SW1 command configured.

Answer Options - Click Tabs to Reveal

You can learn a lot and strengthen real learning of the topics by creating the configuration – even without a router or switch CLI. In fact, these labs were originally built to be used solely as a paper exercise!

To answer, just think about the lab. Refer to your primary learning material for CCNA, your notes, and create the configuration on paper or in a text editor. Then check your answer versus the answer post, which is linked at the bottom of the lab, just above the comments section.

You can also implement the lab using the Cisco Packet Tracer network simulator. With this option, you use Cisco’s free Packet Tracer simulator. You open a file that begins with the initial configuration already loaded. Then you implement your configuration and test to determine if it met the requirements of the lab.

(Use this link for more information about Cisco Packet Tracer.)

Use this workflow to do the labs in Cisco Packet Tracer:

  1. Download the .pkt file linked below.
  2. Open the .pkt file, creating a working lab with the same topology and interfaces as the lab exercise.
  3. Add your planned configuration to the lab.
  4. Test the configuration using some of the suggestions below.

Download this lab’s Packet Tracer File

You can also implement the lab using Cisco Modeling Labs – Personal (CML-P). CML-P (or simply CML) replaced Cisco Virtual Internet Routing Lab (VIRL) software in 2020, in effect serving as VIRL Version 2.

If you prefer to use CML, use a similar workflow as you would use if using Cisco Packet Tracer, as follows:

  1. Download the CML file (filetype .yaml) linked below.
  2. Import the lab’s CML file into CML and then start the lab.
  3. Compare the lab topology and interface IDs to this lab, as they may differ (more detail below).
  4. Add your planned configuration to the lab.
  5. Test the configuration using some of the suggestions below.

Download this lab’s CML file!

 

Network Device Info:

 

Device Lab Port  CML Port
SW1 G1/0/1 G0/1
SW1 G1/0/2 G0/2
SW1 G1/0/3 G0/3
SW1 G1/0/4 G1/0

 

Host device info:

This table lists the interfaces listed in the lab exercise documentation versus those used in the sample CML file.

Device

IP Address

Mac Address

User/password

PC1

10.1.1.1

02:00:11:11:11:11

cisco/cisco

PC2

10.1.1.2

02:00:22:22:22:22

cisco/cisco

PC3

10.3.3.3

02:00:33:33:33:33

cisco/cisco

PC4

10.3.3.4

02:00:44:44:44:44

cisco/cisco

Lab Answers Below: Spoiler Alert

Lab Answers: Configuration (Click Tab to Reveal)

Answers

Example 2: SW1 Config

Commentary, Issues, and Verification Tips (Click Tabs to Reveal)

Creating VLANs on a switch is as simple as typing vlan vlan-id, where vlan-id is a number of your choice. Once the vlan vlan-id command is entered, the switch will immediately create the VLAN and move you to VLAN configuration mode. The name subcommand in VLAN configuration mode can then be used to give the VLAN any name that you would like. This example shows the two VLANs being created with two vlan global commands, each followed by a command to name the VLANs.

Each port needs to be assigned to the correct VLAN per the requirements and figure. The switchport access vlan vlan-id command makes that assignment.

Finally, this configuration does not include the switchport mode access command, but you would likely also add that command to each port. The lab did not comment on whether the configuration should ensure each port acts as an access port. As shown here, each port could negotiate VLAN trunking. With the switchport mode access command on a port, it would operate only as an access port and use the VLAN as defined in the switchport access vlan command.

Known Issues in this Lab

This section of each Config Lab Answers post hopes to help with those issues by listing any known issues with Packet Tracer related to this lab. In this case, the issues are:

# Summary Detail
1 None No known issues related to this lab.

 

Why Would Cisco Packet Tracer Have Issues?

(Note: The below text is the same in every Config Lab.)

Cisco Packet Tracer (CPT) simulates Cisco routers and switches. However, CPT does not run the same software that runs in real Cisco routers and switches. Instead, developers wrote CPT to predict the output a real router or switch would display given the same topology and configuration – but without performing all the same tasks, an actual device has to do. On a positive note, CPT requires far less CPU and RAM than a lab full of devices so that you can run CPT on your computer as an app. In addition, simulators like CPT help you learn about the Cisco router/switch user interface – the Command Line Interface (CLI) – without having to own real devices.

CPT can have issues compared to real devices because CPT does not run the same software as Cisco devices. CPT does not support all commands or parameters of a command. CPT may supply output from a command that differs in some ways from what an actual device would give. Those differences can be a problem for anyone learning networking technology because you may not have experience with that technology on real gear – so you may not notice the differences. So this section lists differences and issues that we have seen when using CPT to do this lab.

Beyond comparing your answers to this lab’s Answers post, you can test in Cisco Packet Tracer (CPT) or Cisco Modeling Labs (CML). In fact, you can and should explore the lab once configured. For this lab, once you have completed the configuration, try these verification steps. 

  1. The show vlan brief command should list the G1/0/1 and G1/0/2 interface in VLAN 10, with G1/0/3 and G1/0/4 in VLAN 20.
  2. The show mac address-table command would list learned MAC addresses in VLAN 10 and 20 on the ports as shown in the figure.
    1. You can define IP addresses for the four PCs and attempt to ping. PC1 and PC2 should have addresses in one subnet, with PC3 and PC4 using addresses in a second subnet.
    2. PC1 and PC2 should ping each other, PC3 and PC4 should ping each other, but PC1/PC2 should not be able to ping PC3/PC4, as there is no router or layer 3 switch in the lab to route packets between the subnets.

More Labs with Related Content!

Config Lab: Switch IP Config
Config Lab: Data and Voice VLANs 1
Wendell Odom
By Wendell Odom September 3, 2021 09:05
Write a comment

No Comments

No Comments Yet!

Let me tell You a sad story ! There are no comments yet, but You can be first one to comment this article.

Write a comment
View comments

Write a comment

Comment; Identify w/ Social Media or Email

Subscribe

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Search

Categories