VLAN basic configuration with CLI || Cisco Packet Tracer Tutorial 7
3 min read
6 hours ago
Published on Feb 28, 2025
This response is partially generated with the help of AI. It may contain inaccuracies.
Table of Contents
Introduction
This tutorial will guide you through the basic configuration of VLANs using the command-line interface (CLI) in Cisco Packet Tracer. You will learn how to create VLANs and assign different IP addresses to switches and end devices. Understanding VLAN configuration is essential for network management and segmentation.
Step 1: Set Up Your Environment
- Open Cisco Packet Tracer: Launch the application to begin your configuration.
- Add Devices: Drag and drop three switches and several end devices (PCs) onto the workspace.
- Connect Devices: Use the appropriate cables to connect the devices to the switches.
- Use straight-through cables for connections between switches and PCs.
Step 2: Access the Switch CLI
- Click on a Switch: Select one of the switches to open its configuration window.
- Go to the CLI Tab: Navigate to the CLI tab within the switch configuration window.
- Enter Privileged EXEC Mode: Type the command below and press Enter:
enable
Step 3: Create VLANs
- Enter Global Configuration Mode: Type the command below:
configure terminal
- Create a VLAN: Use the command below to create a VLAN (replace
10
with your desired VLAN ID):vlan 10
- Name the VLAN (optional): To name the VLAN, use the command:
name VLAN10
Step 4: Assign VLANs to Switch Ports
- Select the Interface: Choose the interface you want to assign to the VLAN (e.g., FastEthernet 0/1):
interface FastEthernet0/1
- Assign the VLAN: Use the following command to assign the VLAN to the selected interface:
switchport mode access switchport access vlan 10
- Exit the Interface: Type
exit
to return to the global configuration mode.
Step 5: Configure IP Addresses for End Devices
- Select an End Device: Click on a PC connected to the switch.
- Go to the Desktop Tab: Select the Desktop tab and then the IP Configuration option.
- Assign an IP Address: Enter the IP address and subnet mask for the device. For example:
- IP Address:
192.168.10.2
- Subnet Mask:
255.255.255.0
- IP Address:
- Repeat for Other Devices: Assign different IP addresses to other PCs as needed, ensuring they are in the same subnet.
Step 6: Test Connectivity
- Use the Ping Command: Open the command prompt on one of the PCs and use the ping command to test connectivity:
ping 192.168.10.1 (replace with the IP of another device)
- Check Responses: Verify that you receive replies to ensure that the VLAN configuration is correct.
Conclusion
You have successfully configured VLANs using the CLI in Cisco Packet Tracer. Key steps included setting up your environment, creating VLANs, assigning them to switch ports, and configuring IP addresses for end devices. For further practice, consider creating additional VLANs and experimenting with inter-VLAN routing. This foundational knowledge will be essential as you continue to explore network configurations.